home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / graphics / svgapv20.arj / SVGABC.TXT < prev    next >
Text File  |  1994-03-11  |  246KB  |  10,327 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                   REFERENCE MANUAL
  9.  
  10.  
  11.                                    FOR SVGAQB.LIB
  12.  
  13.  
  14.                                    AND SVGAPV.LIB
  15.  
  16.  
  17.                                     THE SUPER VGA
  18.  
  19.  
  20.                                   GRAPHICS LIBRARY
  21.  
  22.  
  23.                                    TO BE USED WITH
  24.  
  25.  
  26.                                 MICROSOFT QUICKBASIC,
  27.  
  28.  
  29.                                 VISUAL BASIC FOR DOS
  30.  
  31.  
  32.                                AND BASIC PROFESSIONAL
  33.  
  34.  
  35.                                  DEVELOPMENT SYSTEM
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.           1993-1994 by Zephyr Software - Stephen L. Balkum and Daniel A.
  57.           Sill
  58.  
  59.           All rights reserved.  No part of this book shall be reproduced or
  60.           transmitted by any means, electronic, mechanical, photocopying,
  61.           recording or otherwise, without written permission from Zephyr
  62.           Software - Stephen L. Balkum and Daniel A. Sill.
  63.  
  64.           Although every effort has been made to insure the accuracy of the
  65.           material in this book, Zephyr Software, Stephen L. Balkum and
  66.           Daniel A. Sill assume no responsibility for errors or omissions.
  67.           In addition no liability is assumed for damages resulting from
  68.           the use of the information contained herein.
  69.  
  70.           Printed in the United States of America
  71.  
  72.           Trademarks
  73.  
  74.           The Graphics Interchange Format (c) is the Copyright property of
  75.           CompuServe Incorporated.
  76.           GIF (sm) is a Service Mark property of CompuServe Incorporated.
  77.           Sound Blaster and Sound Blaster Pro are trademarks of Creative
  78.           Labs, Inc.
  79.           All others are trademarks of their respective owners.
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.                                                                          ii
  98.  
  99.  
  100.  
  101.  
  102.  
  103.                              SOFTWARE LICENSE AGREEMENT
  104.  
  105.                By using this software, you agree to the terms of this
  106.                                      agreement.
  107.  
  108.                No warranties are expressed or implied.  In no event
  109.                shall Zephyr Software, Stephen L. Balkum or Daniel A.
  110.                Sill be held liable for damages resulting from the use
  111.                or misuse of this product, including but not limited to
  112.                implied warranties of fitness for a particular purpose.
  113.  
  114.                The shareware version may be freely distributed as long
  115.                as all files stay together and are not modified in any
  116.                way.  No cost may be charged for the shareware version
  117.                beyond normal and reasonable copying and distribution
  118.                expenses.
  119.  
  120.                No products developed with this software shall be sold
  121.                unless this software has been registered with Zephyr
  122.                Software, Stephen L. Balkum or Daniel A. Sill.
  123.  
  124.                At no time for any reason shall this software be
  125.                reverse engineered, decompiled or disassembled.
  126.  
  127.                This software may not be rented or leased.
  128.  
  129.                This software may be used only on one terminal or one
  130.                computer at any one given moment in time.  This
  131.                software may not be installed on a network of any type.
  132.                Contact Zephyr Software, Stephen L. Balkum or Daniel A.
  133.                Sill for networking options.
  134.  
  135.                United States Government Restricted Rights:
  136.                Use, duplication or disclosure of this software and
  137.                documentation by the U.S. Government is subject to the
  138.                restrictions as set forth in subparagraph (c)(1)(ii) of
  139.                the Rights in Technical Data and Computer Software
  140.                clause at DFARS 252.227-7013.  Contractor/manufacturer
  141.                is Stephen L. Balkum and Daniel A. Sill, P.O. Box 7704,
  142.                Austin, Texas 78713-7704.
  143.  
  144.                The ownership of this software may be transferred as
  145.                long as Zephyr Software, Stephen L. Balkum or Daniel A.
  146.                Sill is notified in writing of the transfer date and
  147.                new owner.  The new owner must agree to this contract.
  148.                The transfer must include all registered updates and
  149.                previously registered versions.  The original owner may
  150.                not retain any copies in any form of the registered
  151.                software or its documents.
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.                                                                         iii
  160.  
  161.  
  162.  
  163.  
  164.  
  165.           INTRODUCTION
  166.  
  167.           We spent weeks searching the depths of the internet ftp sites for
  168.           a library that would allow the programmer full access to the
  169.           abilities of Super VGA.  We wanted the colors VGA could provide
  170.           and better resolution than EGA could provide.  Professionally
  171.           developed libraries with this ability were definitely out of our
  172.           price range.  After our searches continuously returned nothing,
  173.           we decided to fill the apparent void in the shareware market.
  174.  
  175.           Our searches did give two useful packages:  John Bridges' VGAKIT
  176.           and Finn Thoegersen's VGADOC.  We began with these two works and
  177.           developed a graphics library intended to allow the programmer
  178.           access to the huge world of high resolution programming.
  179.  
  180.           On the surface the task appeared quite simple.  However, it
  181.           quickly became obvious that the routines in this library would be
  182.           required to affect extremely large amounts of data.  Operations
  183.           must be quick to be successful.  Therefore, every effort was made
  184.           to create the fastest code possible - even at the expense of
  185.           size.  For this reason we opted to write code with the 32 bit
  186.           instructions of the 80386 and 80486 chips.  It is our opinion
  187.           that anyone with a hi-res card in a lesser machine may have some
  188.           priorities out of order. All routines are written in assembly and
  189.           use absolutely no floating point values.  Anytime a real number
  190.           was required, fixed point notation was used.  In addition we
  191.           attempted to write the routines such that any reasonable argument
  192.           passed can be interpreted intelligently by the library.
  193.  
  194.           With the numerous Super VGA cards available and no well
  195.           established standard we chose John Bridges' identification and
  196.           bank switching routines as a beginning.  These two routines have
  197.           undergone some modification, but not enough to justify
  198.           copyrighting this portion of the library's code by Zephyr
  199.           Software.  We have no intentions of releasing our changes to
  200.           these routines into the public domain.  From that point onward
  201.           all code is original.  In some instances common algorithms were
  202.           researched and original code written according to that algorithm.
  203.  
  204.           This Super VGA library gives the programmer transparent access to
  205.           twenty different Super VGA cards.  These cards include Acumos,
  206.           Ahead, ATI Technologies, Avance, Chips and Technologies, Cirrus
  207.           Logic, Everex, Genoa, MXIC, NCR, Oak Technologies,
  208.           Paradise/Western Digital, Primus, Realtek, Trident, Tseng Labs,
  209.           Video 7 and the VESA standard.  Please see the WHICHVGA function
  210.           for the specific chipsets.  The programmer only needs to verify
  211.           that the end user's card has been identified, but not which card
  212.           was recognized.  After proper identification, all functions react
  213.           in exactly the same fashion.  The library contains functions to
  214.           draw all of the major primitives.  In addition there are
  215.           functions that modify the screen palette, write text on the
  216.           screen with a choice of fonts and modify the reaction of the
  217.           primitives.  Identification routines include not only the video
  218.           card, but also the amount of video memory, type of processor and
  219.  
  220.  
  221.                                                                           2
  222.  
  223.  
  224.  
  225.  
  226.  
  227.           installed pointing devices.  Advanced functions provide full
  228.           mouse support (when used with a Microsoft compatible driver) and
  229.           joystick support.  Finally, support for two dimensional and three
  230.           dimensional coordinate systems is provided including rotation,
  231.           translation, scaling and projection.
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.                                                                           3
  284.  
  285.  
  286.  
  287.  
  288.  
  289.           SUGGESTED METHODS FOR USING THIS LIBRARY
  290.  
  291.           USE WITHIN THE BASIC ENVIRONMENT
  292.  
  293.           We assume that the programmer is familiar with all of the
  294.           capabilities of the Microsoft QuickBasic, Visual Basic (VBDOS) or
  295.           Basic Professional Development System (PDS) compiler and
  296.           environment.  Understanding of the LIB and LINK commands is
  297.           encouraged as well as the use of QuickLibraries.  However, to
  298.           ensure you are able to get up and running quickly, the following
  299.           commands may be helpful:
  300.  
  301.           To create a QuickLibrary from SVGAQB/PV.LIB, type the command:
  302.  
  303.               LINK /QU SVGAQB/PV.LIB, SVGAQB/PV.QLB, NUL, QUICKQLB.LIB
  304.  
  305.           where QUICKQLB.LIB is the name for your compiler's QuickLibrary
  306.           (BQLB45.LIB for QuickBasic 4.5, VBDOSQLB.LIB for VBDOS and
  307.           QBXQLB.LIB for PDS).
  308.  
  309.           If you wish to create a QuickLibrary from SVGAQB/PV.LIB and
  310.           additional libraries, type the command:
  311.  
  312.               LINK /QU SVGAQB/PV.LIB + ????.LIB (continue as desired),
  313.                             NEWLIB.QLB, NUL, QUICKQLB.LIB
  314.  
  315.           where QUICKQLB.LIB is the same as above and ????.LIB represents
  316.           the additional desired libraries.
  317.  
  318.           After the QuickLibrary has been created, you should start your
  319.           development environment by typing:
  320.  
  321.                     QuickBasic:    QB /L SVGAQB
  322.                     VBDOS:         VBDOS /L SVGAPV
  323.                     PDS:           QBX /L SVGAPV
  324.  
  325.           This will tell the compiler to use the QuickLibrary when running
  326.           and when creating an executable.
  327.  
  328.           VERIFICATION OF A COMPUTER'S HARDWARE
  329.  
  330.           It is strongly recommended that any program written with this
  331.           library first verifies that the computer is a 80386 or better by
  332.           calling the WHICHCPU function.  Many of the library's functions
  333.           use 386 exclusive code which may cause a computer with a lesser
  334.           processor to crash.  In addition WHICHMOUSE must be called before
  335.           calling any of the mouse functions.  Lastly, it is recommended
  336.           that WHICHJOYSTICK be called before a program uses the joystick
  337.           routines.
  338.  
  339.           It is required that a program call WHICHVGA prior to any function
  340.           that communicates with the video card.  If WHICHVGA returns a
  341.           zero for unknown card type, the program should not call any
  342.           graphics function.  Without proper identification of the video
  343.  
  344.  
  345.                                                                           4
  346.  
  347.  
  348.  
  349.  
  350.  
  351.           card any graphics function will likely cause a system failure.
  352.           It is recommended, although not necessary, that a program call
  353.           WHICHMEM prior to calling any RES function.  Although the video
  354.           card was properly identified, it may not have sufficient onboard
  355.           memory to support the desired resolution.  As a second check the
  356.           RES functions will do nothing if the video card has not been
  357.           identified or if the video card does not support the specified
  358.           resolution for memory or hardware reasons.
  359.  
  360.           THE 256 COLOR PALETTE
  361.  
  362.           The 256 color palette of the Super VGA cards is a six bit
  363.           palette.  Each of the 256 colors of the palette are described by
  364.           three values representing the intensity of the colors red, blue
  365.           and green.  These values can range from 0 to 63.  Anytime a value
  366.           outside of this range is used, the video card simply ignores the
  367.           upper two bits.  Therefore, 64 is the same as 0.  This should be
  368.           taken into consideration when manipulating the palette or when
  369.           importing a palette from an external source such as a GIF image.
  370.  
  371.           USE OF 2-D AND 3-D FUNCTIONS
  372.  
  373.           In the interest of speed, the 2-D and 3-D functions were written
  374.           to best work on multiple points at once.  We refer to these
  375.           functions as object-oriented.  This means that the points
  376.           defining an object (a box, a house, etc.) should be contained
  377.           within one array or part of an array and calls to the functions
  378.           should act on all of the points in the array.  Calls to functions
  379.           have a high speed overhead, therefore, placing more than one
  380.           object in the same array and passing the entire array to the
  381.           functions can be beneficial.  However, these functions will work
  382.           on a single point as well.
  383.  
  384.           Another consequence of our object-oriented 2-D and 3-D functions
  385.           is the use of the scaling functions.  When scaling objects, we
  386.           recommend the object be defined about the origin.  D2SCALE and
  387.           D3SCALE both work with respect to the origin.  This eliminates a
  388.           significant number of translations that would otherwise be
  389.           required by having a definable scale origin.  For example, to
  390.           draw two boxes, one scaled by one-half of the other, each rotated
  391.           by 45 degrees at the center of the screen, the recommended
  392.           procedure is as follows:
  393.  
  394.             define an array BOX containing the 2-D points: (100, 100), (-
  395.                100, 100), (-100, -100), (100, -100), (note: the box is
  396.                centered about the origin.)
  397.             rotate BOX by 45 degrees about (0, 0) and place the output in
  398.                RBOX,
  399.             scale RBOX by 50% (scaling factor would be 128, or 80 hex) and
  400.                place output in SRBOX,
  401.             translate RBOX to the center of the screen - a translation of
  402.                320, 240 in 640x480 resolution - and place output in TRBOX,
  403.             translate SRBOX to the center of the screen - same translation
  404.                as for RBOX - and place output in TSRBOX,
  405.  
  406.  
  407.                                                                           5
  408.  
  409.  
  410.  
  411.  
  412.  
  413.             draw TRBOX and TSRBOX on the screen.
  414.  
  415.           Notice that by defining the box centered about the origin the
  416.           translation values were extremely intuitive.  Also notice that if
  417.           we had scaled the second box after the translation, it would have
  418.           been draw in the upper left quadrant of the screen instead of the
  419.           center.
  420.  
  421.           In mathematics and many sciences it is customary that in a 2-D
  422.           coordinate system the Y axis increases upward and the X axis
  423.           increases to the right.  The computer industry has decided the Y
  424.           axis should increase downward.  The 2-D functions are not
  425.           affected by the choice in coordinate systems.  However, it is
  426.           important to remember that a positive rotation in D2ROTATE
  427.           rotates from the positive X axis to the positive Y axis.
  428.           Therefore, when using mathematical conventions, a positive
  429.           rotation moves counter-clockwise.  On the computer screen a
  430.           positive rotation moves clockwise.
  431.  
  432.           The 3-D coordinate system follows mathematical conventions by
  433.           using a right-handed coordinate system.  The easiest way to
  434.           visualize this coordinate system is by using your right hand.
  435.           Place your index finger and thumb at a right angle to one another
  436.           as if to form an imaginary pistol.  Now place your second finger
  437.           at a right angle to your index finger.  It should be at a right
  438.           angle to your thumb as well.  This represents the three axes.
  439.           The index finger is the X axis, the second finger is the Y axis
  440.           and the thumb is the Z axis.  The easiest way to remember
  441.           rotation directions in this system is cyclically.  A positive
  442.           rotation about the X axis rotates the Y axis into the Z axis.  A
  443.           positive rotation about the Y axis rotates the Z axis into the X
  444.           axis.  A positive rotation about the Z axis rotates the X axis
  445.           into the Y axis.
  446.  
  447.           After doing all necessary 3-D transformations, projection onto
  448.           the 2-D computer screen is required.  Although the computer
  449.           screen's coordinate system does not follow mathematical
  450.           conventions, the D3PROJECT function automatically takes care of
  451.           all conversions.  The programmer only needs to draw the resulting
  452.           lines on the screen.
  453.  
  454.           THE CONCEPT OF SPRITE GRAPHICS
  455.  
  456.           The key to sprite graphics is the assumption that only a small
  457.           percentage of the pixels in a graphics block are used by the
  458.           animation and the remaining pixels should be treated as
  459.           transparent, revealing the background behind the sprite.  The
  460.           sprite routines in this library only act on non-transparent
  461.           colors, thus, saving time by ignoring a large number of pixels.
  462.           When retrieving the background for a sprite, prior knowledge of
  463.           the sprite itself permits obtaining background only where it is
  464.           necessary.
  465.  
  466.  
  467.  
  468.  
  469.                                                                           6
  470.  
  471.  
  472.  
  473.  
  474.  
  475.           The following steps outline an example of the recommended
  476.           procedure for using the sprite functions:
  477.  
  478.             1. draw the sprite on the screen - a white stick figure on a
  479.                black background, for example
  480.             2. use BLKGET to place the sprite in an array STICK
  481.             3. use SPRITEGAP to simultaneously retrieve the background into
  482.                BACKSTICK and place STICK on the screen, declaring black as
  483.                the transparent color
  484.             4. use SPRITEPUT to replace the background BACKSTICK in the
  485.                same location as step 3
  486.             5. repeat steps 3 and 4 as many times and in as many locations
  487.                as desired
  488.  
  489.           EXTENDED MEMORY SUPPORT
  490.  
  491.           With the higher screen resolutions, more memory may be needed for
  492.           data storage.  For this reason extended memory support is
  493.           provided.  Accessing extended memory requires the computer to
  494.           switch into protected mode.  The process of switching into
  495.           protected mode and returning is handled by the extended memory
  496.           manager, usually HIMEM.SYS.  The switch is relatively slow.
  497.           Therefore, it should be used as fast storage access since it is
  498.           much faster than disk access.
  499.  
  500.           Extended memory access is also limited by the number of available
  501.           handles.  The limit is controlled by a switch on the extended
  502.           memory manager's command line and normally defaults to 32.  Also,
  503.           it is imperative that all allocated extended memory blocks be
  504.           freed before the program terminates.  Unfreed memory blocks will
  505.           be unavailable until the computer is rebooted.
  506.  
  507.           CONVENTIONS USED IN THIS MANUAL
  508.  
  509.           All parameters, other than strings, passed to and from functions
  510.           and procedures in this QuickBasic library are short (two byte)
  511.           integers.  No floating point values are used.
  512.  
  513.           Whenever a pixel is written on the screen, a mode is required.
  514.           Unless otherwise noted, there are four possible modes:  SET, XOR,
  515.           OR and AND.  These modes are represented by the numbers one
  516.           through four respectively.  Technically, SET is the fastest mode.
  517.           However, XOR maybe the most useful.  XOR'ing a point twice with
  518.           the same color returns the original color.  This can be used to
  519.           cover and uncover graphics.  In addition when a reference to a
  520.           color index is made, only values between and including 0 and 255
  521.           are valid.  Any integer will work, but only the lowest eight bits
  522.           are recognized.
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.                                                                           7
  532.  
  533.  
  534.  
  535.  
  536.  
  537.           BLKGET
  538.  
  539.             PROTOTYPE
  540.  
  541.             SUB BLKGET (X1%, Y1%, X2%, Y2%, GfxBlk%)
  542.  
  543.             INPUT
  544.  
  545.             X1, Y1 - top left corner of block
  546.             X2, Y2 - bottom right corner of block
  547.  
  548.             OUTPUT
  549.  
  550.             If declared as a function, BLKGET returns 1 if successful, 0
  551.             if failed.
  552.             GfxBlk - integer destination array holding retrieved bitmap
  553.  
  554.             USAGE
  555.  
  556.             BLKGET stores the pixel data contained within the block
  557.             defined by (X1, Y1)-(X2, Y2) in the variable referenced by
  558.             GfxBlk.  GfxBlk must be dimensioned as a short integer array
  559.             with a size in integers equal to
  560.                              [(X2-X1+1)*(Y2-Y1+1)] / 2+3.
  561.  
  562.             Note, however, that GfxBlk can be quite large.  If the size of
  563.             GfxBlk is insufficient, BLKGET will overwrite any data in
  564.             memory contained beyond GfxBlk and may possibly cause the
  565.             system to crash.  BLKGET enforces X2 X1 and Y2Y1.  Also, the
  566.             coordinates must be valid on the screen at the current
  567.             resolution.
  568.  
  569.             The bitmap is stored such that the first integer in the
  570.             destination array is the width and the second integer is the
  571.             height.  The remaining bytes are the bitmap raster data stored
  572.             by rows starting at the top of the block.
  573.  
  574.             Arrays should be passed by giving the element within the array
  575.             from where the action should take place.  This allows the
  576.             programmer to store more than one item within the same array
  577.             or act on only a portion of the array.
  578.  
  579.             SEE ALSO
  580.  
  581.             BLKPUT, BLKRESIZE, BLKROTATE, GETLASTSTRING, SPRITEGAP,
  582.             SPRITEGET, SPRITEPUT
  583.  
  584.             EXAMPLE
  585.  
  586.             REM PLACES 1/4 OF A CIRCLE AT THE CENTER OF THE SCREEN
  587.             REM $INCLUDE: 'SVGABC.BI'
  588.             DEFINT A-Z
  589.             DIM BLOCKDATA(0 TO 483) AS INTEGER
  590.             IF WHICHVGA = 0 THEN STOP
  591.  
  592.  
  593.                                                                           8
  594.  
  595.  
  596.  
  597.  
  598.  
  599.             DUMMY=RES640
  600.             DRWCIRCLE 1, 10, 30, 30, 20
  601.             FILLAREA 30, 30, 10, 7
  602.             BLKGET 0, 0, 30, 30, BLOCKDATA(0)
  603.             BLKPUT 1, 320, 240, BLOCKDATA(0)
  604.             WHILE INKEY$ = ""
  605.             WEND
  606.             DUMMY=RESTEXT
  607.             END
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                                                                           9
  656.  
  657.  
  658.  
  659.  
  660.  
  661.           BLKPUT
  662.  
  663.             PROTOTYPE
  664.  
  665.             SUB BLKPUT (Mode%, X%, Y%, GfxBlk%)
  666.  
  667.             INPUT
  668.  
  669.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  670.             X, Y - location for top left corner of block
  671.             GfxBlk - integer source array
  672.  
  673.             OUTPUT
  674.  
  675.             no value returned
  676.  
  677.             USAGE
  678.  
  679.             BLKPUT places the pixel data contained in the variable
  680.             referenced by GfxBlk on the screen.  The top, left corner of
  681.             the block is specified by (X, Y).  Any (X, Y) is acceptable
  682.             and any portion of the block that lies outside of the
  683.             currently defined viewport will not be drawn.
  684.  
  685.             Arrays should be passed by giving the element within the array
  686.             from where the action should take place.  This allows the
  687.             programmer to store more than one item within the same array
  688.             or act on only a portion of the array.
  689.  
  690.             SEE ALSO
  691.  
  692.             BLKGET, BLKRESIZE, BLKROTATE, GETLASTSTRING, SPRITEGAP,
  693.             SPRITEGET, SPRITEPUT, GIFPUT, SETVIEW
  694.  
  695.             EXAMPLE
  696.  
  697.             See BLKGET
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.                                                                          10
  718.  
  719.  
  720.  
  721.  
  722.  
  723.           BLKRESIZE
  724.  
  725.             PROTOTYPE
  726.  
  727.             SUB BLKRESIZE (NewXSize%, NewYSize%, SourceGfxBlk%,
  728.             DestGfxBlk%)
  729.  
  730.             INPUT
  731.  
  732.             NewXSize, NewYSize - size of resulting bitmap in DestGfxBlk
  733.             SourceGfxBlk - integer source array
  734.  
  735.             OUTPUT
  736.  
  737.             no value returned
  738.             DestGfxBlk - integer destination array holding resized bitmap
  739.  
  740.             USAGE
  741.  
  742.             BLKRESIZE takes the bitmap in SourceGfxBlk and scales it up or
  743.             down according the to values passed in NewXSize and NewYSize.
  744.             The resulting bitmap is returned in DestGfxBlk which should
  745.             already be declared with a size calculated according to the
  746.             equation in BLKGET.  NewXSize and NewYSize should not be zero.
  747.  
  748.             SEE ALSO
  749.  
  750.             BLKGET, BLKPUT, BLKROTATE
  751.  
  752.             EXAMPLE
  753.  
  754.             REM  RESIZE A BITMAP
  755.             REM $INCLUDE: 'SVGABC.BI'
  756.             DEFINT A-Z
  757.             DIM SRC%(0 TO 32000)
  758.             DIM DST%(0 TO 32000)
  759.  
  760.             IF WHICHCPU < 386 THEN END
  761.             IF WHICHVGA = 0 THEN END
  762.             VMODE=VIDEOMODEGET
  763.             IF RES640 <> 1 THEN
  764.                 DUMMY = RESTEXT
  765.                 END
  766.             END IF
  767.             X1 = 0
  768.             Y1 = 0
  769.             X2 = 50
  770.             Y2 = 50
  771.             FOR I = 0 TO 25
  772.                 XA = (RND * X2 - X1) + X1
  773.                 YA = (RND * Y2 - Y1) + Y1
  774.                 XB = (RND * X2 - X1) + X1
  775.                 YB = (RND * Y2 - Y1) + Y1
  776.                 C = RND * 16
  777.  
  778.  
  779.                                                                          11
  780.  
  781.  
  782.  
  783.  
  784.  
  785.                 DRWLINE 1, C, XA, YA, XB, YB
  786.             NEXT I
  787.             DRWBOX 1, 15, X1, Y1, X2, Y2
  788.             BLKGET X1, Y1, X2, Y2, SRC(0)
  789.             X1 = GETMAXX \ 2
  790.             Y1 = GETMAXY \ 2
  791.             X = SRC(0) + 1
  792.             Y = SRC(1) + 1
  793.             BLKRESIZE X, Y, SRC(0), DST(0)
  794.             BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  795.             FOR I = X TO X + 50
  796.                 BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  797.                 BLKRESIZE I, I, SRC(0), DST(0)
  798.                 BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  799.                 SDELAY 3
  800.             NEXT I
  801.             FOR I = X + 50 TO X - 50 STEP -1
  802.                 BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  803.                 BLKRESIZE I, I, SRC(0), DST(0)
  804.                 BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  805.                 SDELAY 3
  806.             NEXT I
  807.             FOR I = X - 50 TO X
  808.                 BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  809.                 BLKRESIZE I, I, SRC(0), DST(0)
  810.                 BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  811.                 SDELAY 3
  812.             NEXT I
  813.             VIDEOMODESET VMODE
  814.             END
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.                                                                          12
  842.  
  843.  
  844.  
  845.  
  846.  
  847.           BLKROTATE
  848.  
  849.             PROTOTYPE
  850.  
  851.             FUNCTION BLKROTATE% (Ang%, BackFillColor%, SourceGfxBlk%,
  852.             DestGfxBlk%)
  853.  
  854.             INPUT
  855.  
  856.             Ang - integer degree to rotate source bitmap
  857.             BackFillColor - index to color in current palette to fill
  858.             blank space in DestGfxBlk
  859.             SourceGfxBlk - integer source array
  860.  
  861.             OUTPUT
  862.  
  863.             BLKROTATE returns 1 if successful, 0 if unsuccessful.
  864.             DestGfxBlk - integer destination array holding rotated bitmap
  865.  
  866.             USAGE
  867.  
  868.             BLKROTATE takes the bitmap in SourceGfxBlk and rotates by the
  869.             number of degrees specified in Ang.  The bitmap rotation
  870.             algorithm is a three-pass shear technique modified to make
  871.             efficient use of this library's internal buffers.  Blank space
  872.             around the newly rotated block is filled with the color given
  873.             by BackFillColor.  The resulting bitmap is stored in
  874.             DestGfxBlk.  The size of DestGfxBlk should be at least as big
  875.             as given by BLKROTATESIZE.
  876.  
  877.             The function will fail if it calculates that the internal
  878.             buffers would be overflowed or if the destination array would
  879.             be larger than 65536 bytes.  BLKROTATESIZE should be called
  880.             first to ensure that buffer integrity is maintained.
  881.  
  882.             SEE ALSO
  883.  
  884.             BLKGET, BLKPUT, BLKRESIZE, BLKROTATESIZE
  885.  
  886.             EXAMPLE
  887.  
  888.             REM ROTATE A BITMAP
  889.             REM $INCLUDE: 'SVGABC.BI'
  890.             DEFINT A-Z
  891.             DIM SRC%(0 TO 32000)
  892.             DIM DST%(0 TO 32000)
  893.             IF WHICHCPU < 386 THEN END
  894.             IF WHICHVGA = 0 THEN END
  895.             VMODE = VIDEOMODEGET
  896.             IF RES640 <> 1 THEN
  897.                 DUMMY = RESTEXT
  898.                 END
  899.             END IF
  900.             X1 = 0
  901.  
  902.  
  903.                                                                          13
  904.  
  905.  
  906.  
  907.  
  908.  
  909.             Y1 = 0
  910.             X2 = 110
  911.             Y2 = 110
  912.             FOR I = 0 TO 50
  913.                 XA = (RND * X2 - X1) + X1
  914.                 YA = (RND * Y2 - Y1) + Y1
  915.                 XB = (RND * X2 - X1) + X1
  916.                 YB = (RND * Y2 - Y1) + Y1
  917.                 C = RND * 16
  918.                 DRWLINE 1, C, XA, YA, XB, YB
  919.             NEXT I
  920.             DRWBOX 1, 15, X1, Y1, X2, Y2
  921.             BLKGET X1, Y1, X2, Y2, SRC(0)
  922.             X1 = GETMAXX \ 2
  923.             Y1 = GETMAXY \ 2
  924.             FOR I = 0 TO 359 STEP 6
  925.                 IF BLKROTATESIZE(I, SRC(0)) <> 0 THEN
  926.                  DUMMY = BLKROTATE(I, 0, SRC(0), DST(0))
  927.                  BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  928.                  SDELAY 3
  929.                  BLKPUT 2, X1 - DST(0) \ 2, Y1 - DST(1) \ 2, DST(0)
  930.                 END IF
  931.             NEXT I
  932.             VIDEOMODESET VMODE
  933.             END
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.                                                                          14
  966.  
  967.  
  968.  
  969.  
  970.  
  971.           BLKROTATESIZE
  972.  
  973.             PROTOTYPE
  974.  
  975.             FUNCTION BLKROTATESIZE& (Ang%, SourceGfxBlk%)
  976.  
  977.             INPUT
  978.  
  979.             Ang - integer degree to rotate source bitmap
  980.             SourceGfxBlk - integer source array
  981.  
  982.             OUTPUT
  983.  
  984.             BLKROTATESIZE returns the number of bytes needed for the
  985.             destination array if successful, 0 if unsuccessful.
  986.  
  987.             USAGE
  988.  
  989.             BLKROTATESIZE takes the bitmap in SourceGfxBlk calculates the
  990.             required size of the output buffer needed when BLKROTATE is
  991.             called.  It also insures that the internal library buffers are
  992.             not overflowed.  The function will fail if it calculates that
  993.             the internal buffers would be overflowed or if the destination
  994.             array would be larger than 65536 bytes.  BLKROTATESIZE should
  995.             be called prior to BLKROTATE to ensure that buffer integrity
  996.             is maintained.
  997.  
  998.             SEE ALSO
  999.  
  1000.             BLKGET, BLKPUT, BLKRESIZE, BLKROTATE
  1001.  
  1002.             EXAMPLE
  1003.  
  1004.             See BLKROTATE
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.                                                                          15
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.           BYTECOPY
  1034.  
  1035.             PROTOTYPE
  1036.  
  1037.             SUB BYTECOPY (SrcArray%, DestArray%, NumOfBytes&)
  1038.  
  1039.             INPUT
  1040.  
  1041.             SrcArray - integer array to be copied
  1042.             NumBytes - number of bytes to copy from SrcArray to DestArray
  1043.  
  1044.             OUTPUT
  1045.  
  1046.             no value returned
  1047.             DestArray - integer destination array holding copied data
  1048.  
  1049.             USAGE
  1050.  
  1051.             BYTECOPY copies the specified number of bytes from SrcArray to
  1052.             DestArray.  It is much faster than using a FOR/NEXT loop.  The
  1053.             arrays must be integer arrays.  NumBytes is equal to twice the
  1054.             number of elements to be copied.  For example, if SrcArray
  1055.             contains 10 integers to be copied, NumBytes is 2 * 10, or 20
  1056.             bytes.  The declaration for BYTECOPY can be changed to allow
  1057.             real numbers in which case NumBytes is equal to 4 times the
  1058.             number of elements to be copied.  Note, however, that BYTECOPY
  1059.             will not work with strings.
  1060.  
  1061.             Arrays should be passed by giving the element within the array
  1062.             from where the action should take place.  This allows the
  1063.             programmer to store more than one item within the same array
  1064.             or act on only a portion of the array.
  1065.  
  1066.             SEE ALSO
  1067.  
  1068.             PALCOPY
  1069.  
  1070.             EXAMPLE
  1071.  
  1072.             REM COPIES AN ARRAY
  1073.             REM $INCLUDE: 'SVGABC.BI'
  1074.             DEFINT A-Z
  1075.             DIM ARRAY1(1 TO 10) AS INTEGER
  1076.             DIM ARRAY2(1 TO 10) AS INTEGER
  1077.  
  1078.             CLS
  1079.             FOR I=1 TO 10
  1080.                 ARRAY1(I) = I
  1081.                 ARRAY2(I) = 11 - I
  1082.             NEXT I
  1083.             PRINT "Before copying:"
  1084.             FOR I=1 TO 10
  1085.                 PRINT ARRAY1(I);
  1086.             NEXT I
  1087.  
  1088.  
  1089.                                                                          16
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.             PRINT
  1096.             FOR I=1 TO 10
  1097.                 PRINT ARRAY2(I);
  1098.             NEXT I
  1099.             PRINT
  1100.             BYTECOPY ARRAY1(1), ARRAY2(1), 20
  1101.             PRINT "After copying:"
  1102.             FOR I=1 TO 10
  1103.                 PRINT ARRAY1(I);
  1104.             NEXT I
  1105.             PRINT
  1106.             FOR I=1 TO 10
  1107.                 PRINT ARRAY2(I);
  1108.             NEXT I
  1109.             PRINT
  1110.             END
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.                                                                          17
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.           D2ROTATE
  1158.  
  1159.             PROTOTYPE
  1160.  
  1161.             SUB D2ROTATE (NumPoints%, XOrigin%, YOrigin%, Angle%,
  1162.             InArray%, OutArray%)
  1163.  
  1164.             INPUT
  1165.  
  1166.             NumPoints - number of points to be rotated
  1167.             Xorigin, Yorigin - center of rotation
  1168.             Angle - angle of rotation about center
  1169.             InArray - P2DType array containing points to rotate
  1170.  
  1171.             OUTPUT
  1172.  
  1173.             no value returned
  1174.             OutArray - P2DType array holding rotated values
  1175.  
  1176.             USAGE
  1177.  
  1178.             D2ROTATE takes the two dimensional points given in InArray and
  1179.             rotates them by the specified angle about Xorigin, Yorigin.
  1180.             The results are returned in OutArray which can be the same as
  1181.             InArray.  A positive angle causes a clockwise rotation on the
  1182.             screen, from the positive X axis to the positive Y axis.
  1183.  
  1184.             Arrays should be passed by giving the element within the array
  1185.             from where the action should take place.  This allows the
  1186.             programmer to store more than one item within the same array
  1187.             or act on only a portion of the array.
  1188.  
  1189.             SEE ALSO
  1190.  
  1191.             D2SCALE, D2TRANSLATE
  1192.  
  1193.             EXAMPLE
  1194.  
  1195.             REM ROTATE A TRIANGLE ABOUT ONE CORNER
  1196.             REM $INCLUDE: 'SVGABC.BI'
  1197.             DEFINT A-Z
  1198.             DIM TRIO(1 TO 3) AS P2DType
  1199.             DIM TRI(1 TO 3) AS P2DType
  1200.             DIM TRI2(1 TO 3) AS P2DType
  1201.  
  1202.             TRIO(1).X = 0
  1203.             TRIO(1).Y = 0
  1204.             TRIO(2).X = -80
  1205.             TRIO(2).Y = 60
  1206.             TRIO(3).X = 80
  1207.             TRIO(3).Y = 60
  1208.             VMODE = VIDEOMODEGET
  1209.             IF WHICHVGA = 0 THEN STOP
  1210.             DUMMY=RES640
  1211.  
  1212.  
  1213.                                                                          18
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.             GOSUB DRWTRI
  1220.             FOR I = 0 TO 360 STEP 2
  1221.             D2ROTATE 3, 0, 0, I, TRIO(1).X, TRI(1).X
  1222.             GOSUB DRWTRI
  1223.             SDELAY 2
  1224.             GOSUB ERTRI
  1225.             NEXT I
  1226.             GOSUB DRWTRI
  1227.             WHILE INKEY$ = ""
  1228.             WEND
  1229.             VIDEOMODESET VMODE
  1230.             END
  1231.  
  1232.             DRWTRI:
  1233.             D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
  1234.             DRWLINE 1, 10, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
  1235.             DRWLINE 1, 10, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
  1236.             DRWLINE 1, 10, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
  1237.             RETURN
  1238.  
  1239.             ERTRI:
  1240.             D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
  1241.             DRWLINE 1, 0, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
  1242.             DRWLINE 1, 0, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
  1243.             DRWLINE 1, 0, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
  1244.             RETURN
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.                                                                          19
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.           D2SCALE
  1282.  
  1283.             PROTOTYPE
  1284.  
  1285.             SUB D2SCALE (NumPoints%, ScaleX%, ScaleY%, InArray%,
  1286.             OutArray%)
  1287.  
  1288.             INPUT
  1289.  
  1290.             NumPoints - number of points to scale
  1291.             ScaleX - scale factor along X axis
  1292.             ScaleY - scale factor along Y axis
  1293.             InArray - P2DType array containing points to scale
  1294.  
  1295.             OUTPUT
  1296.  
  1297.             no value returned
  1298.             OutArray - P2DType array holding scaled values
  1299.  
  1300.             USAGE
  1301.  
  1302.             D2SCALE multiplies each coordinate in the two dimensional
  1303.             array InArray by the corresponding scale factor ScaleX or
  1304.             ScaleY.  The results are stored in OutArray which can be the
  1305.             same as InArray.  A scale factor of 256 (100 hex) is
  1306.             considered 100 percent and results in no change.  Therefore,
  1307.             128 (80 hex) reduces values by one half and 512 (200 hex)
  1308.             doubles values.
  1309.  
  1310.             Arrays should be passed by giving the element within the array
  1311.             from where the action should take place.  This allows the
  1312.             programmer to store more than one item within the same array
  1313.             or act on only a portion of the array.
  1314.  
  1315.             SEE ALSO
  1316.  
  1317.             D2ROTATE, D2TRANSLATE
  1318.  
  1319.             EXAMPLE
  1320.  
  1321.             REM SCALE A TRIANGLE
  1322.             REM $INCLUDE: 'SVGABC.BI'
  1323.             DEFINT A-Z
  1324.             DIM TRIO(1 TO 3) AS P2DType
  1325.             DIM TRI(1 TO 3) AS P2DType
  1326.             DIM TRI2(1 TO 3) AS P2DType
  1327.  
  1328.             TRIO(1).X = 0
  1329.             TRIO(1).Y = 0
  1330.             TRIO(2).X = -80
  1331.             TRIO(2).Y = 60
  1332.             TRIO(3).X = 80
  1333.             TRIO(3).Y = 60
  1334.             VMODE = VIDEOMODEGET
  1335.  
  1336.  
  1337.                                                                          20
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.             IF WHICHVGA = 0 THEN STOP
  1344.             DUMMY=RES640
  1345.             GOSUB DRWTRI
  1346.             FOR I = 256 TO 512 STEP 4
  1347.             D2SCALE 3, I, I, TRIO(1).X, TRI(1).X
  1348.             GOSUB DRWTRI
  1349.             SDELAY 2
  1350.             GOSUB ERTRI
  1351.             NEXT I
  1352.             FOR I = 512 TO 128 STEP -4
  1353.             D2SCALE 3, I, I, TRIO(1).X, TRI(1).X
  1354.             GOSUB DRWTRI
  1355.             SDELAY 2
  1356.             GOSUB ERTRI
  1357.             NEXT I
  1358.  
  1359.             FOR I = 128 TO 256 STEP 4
  1360.             D2SCALE 3, I, I, TRIO(1).X, TRI(1).X
  1361.             GOSUB DRWTRI
  1362.             SDELAY 2
  1363.             GOSUB ERTRI
  1364.             NEXT I
  1365.             GOSUB DRWTRI
  1366.             WHILE INKEY$ = ""
  1367.             WEND
  1368.             VIDEOMODESET VMODE
  1369.             END
  1370.  
  1371.             DRWTRI:
  1372.             D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
  1373.             DRWLINE 1, 10, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
  1374.             DRWLINE 1, 10, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
  1375.             DRWLINE 1, 10, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
  1376.             RETURN
  1377.  
  1378.             ERTRI:
  1379.             D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
  1380.             DRWLINE 1, 0, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
  1381.             DRWLINE 1, 0, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
  1382.             DRWLINE 1, 0, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
  1383.             RETURN
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.                                                                          21
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.           D2TRANSLATE
  1406.  
  1407.             PROTOTYPE
  1408.  
  1409.             SUB D2TRANSLATE (NumPoints%, TransX%, TransY%, InArray%,
  1410.             OutArray%)
  1411.  
  1412.             INPUT
  1413.  
  1414.             NumPoints - number of points to be translated
  1415.             TransX - distance to translate along X axis
  1416.             TransY - distance to translate along Y axis
  1417.             InArray - P2DType array containing points to translate
  1418.  
  1419.             OUTPUT
  1420.  
  1421.             no value returned
  1422.             OutArray - P2DType array holding translated values
  1423.  
  1424.             USAGE
  1425.  
  1426.             D2TRANSLATE takes the two dimensional points given in InArray
  1427.             and translates them by the specified number of pixels along
  1428.             each axis.  The results are returned in OutArray which can be
  1429.             the same as InArray.
  1430.  
  1431.             Arrays should be passed by giving the element within the array
  1432.             from where the action should take place.  This allows the
  1433.             programmer to store more than one item within the same array
  1434.             or act on only a portion of the array.
  1435.  
  1436.             SEE ALSO
  1437.  
  1438.             D2ROTATE, D2SCALE
  1439.  
  1440.             EXAMPLE
  1441.  
  1442.             REM TRANSLATE A TRIANGLE
  1443.             REM $INCLUDE: 'SVGABC.BI'
  1444.             DEFINT A-Z
  1445.             DIM TRIO(1 TO 3) AS P2DType
  1446.             DIM TRI(1 TO 3) AS P2DType
  1447.             DIM TRI2(1 TO 3) AS P2DType
  1448.  
  1449.             TRIO(1).X = 0
  1450.             TRIO(1).Y = 0
  1451.             TRIO(2).X = -80
  1452.             TRIO(2).Y = 60
  1453.             TRIO(3).X = 80
  1454.             TRIO(3).Y = 60
  1455.             VMODE = VIDEOMODEGET
  1456.             IF WHICHVGA = 0 THEN STOP
  1457.             DUMMY=RES640
  1458.             GOSUB DRWTRI
  1459.  
  1460.  
  1461.                                                                          22
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.             FOR I = 0 TO 100 STEP 4
  1468.             D2TRANSLATE 3, I, I, TRIO(1).X, TRI(1).X
  1469.             GOSUB DRWTRI
  1470.             SDELAY 2
  1471.             GOSUB ERTRI
  1472.             NEXT I
  1473.             FOR I = 100 TO 0 STEP -4
  1474.             D2TRANSLATE 3, I, I, TRIO(1).X, TRI(1).X
  1475.             GOSUB DRWTRI
  1476.             SDELAY 2
  1477.             GOSUB ERTRI
  1478.             NEXT I
  1479.             GOSUB DRWTRI
  1480.             WHILE INKEY$ = ""
  1481.             WEND
  1482.             VIDEOMODESET VMODE
  1483.             END
  1484.  
  1485.             DRWTRI:
  1486.             D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
  1487.             DRWLINE 1, 10, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
  1488.             DRWLINE 1, 10, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
  1489.             DRWLINE 1, 10, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
  1490.             RETURN
  1491.  
  1492.             ERTRI:
  1493.             D2TRANSLATE 3, 320, 240, TRI(1).X, TRI2(1).X
  1494.             DRWLINE 1, 0, TRI2(1).X, TRI2(1).Y, TRI2(2).X, TRI2(2).Y
  1495.             DRWLINE 1, 0, TRI2(2).X, TRI2(2).Y, TRI2(3).X, TRI2(3).Y
  1496.             DRWLINE 1, 0, TRI2(3).X, TRI2(3).Y, TRI2(1).X, TRI2(1).Y
  1497.             RETURN
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.                                                                          23
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.           D3PROJECT
  1530.  
  1531.             PROTOTYPE
  1532.  
  1533.             FUNCTION D3PROJECT% (NumPoints%, ProjParams%, InArray%,
  1534.             OutArray%)
  1535.  
  1536.             INPUT
  1537.  
  1538.             NumPoints - number of points to be projected
  1539.             ProjParams - PROJType structure containing parameters used in
  1540.             projection
  1541.                EyeX, EyeY, EyeZ - 3D location of viewer
  1542.                ScrD - distance from viewer to projection screen
  1543.                Theta - angle from positive 3D X axis to viewing direction
  1544.                Phi - angle from positive 3D Z axis to viewing direction
  1545.             InArray - P3DType array containing points to project
  1546.  
  1547.             OUTPUT
  1548.  
  1549.             D3PROJECT returns 1 if successful, 0 if any one point failed.
  1550.             OutArray - P2DType array holding projected values
  1551.  
  1552.             USAGE
  1553.                                 +Z axis
  1554.                                    |                   /\
  1555.                                    |                  /  \
  1556.                                    |            !     \ * \
  1557.                                    |            !......X: /
  1558.                                    |            ! Phi / \/
  1559.                                    |            !    /  :
  1560.                                    |            !   /   :
  1561.                                    |            !  /    :
  1562.                                    |       EyeX ! /ScrD :
  1563.                                    |       EyeY !/      :
  1564.                                    |       EyeZ *- - - -:- - - - -
  1565.                                    |           / `      :
  1566.                                    |          /   `     :
  1567.                                    |         /      `   :
  1568.                                    |        /      ---` :
  1569.                                    |       /___----
  1570.                                    |      /     Theta
  1571.                                    |
  1572.                                    |________________________________+Y axis
  1573.                                   /
  1574.                                  /
  1575.                                 /
  1576.                                /
  1577.                               /
  1578.                              /
  1579.                             /
  1580.                            /
  1581.                           /
  1582.                       +X axis
  1583.  
  1584.  
  1585.                                                                          24
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.             D3PROJECT projects a specified number, NumPoints, of three
  1593.             dimensional points starting at InArray into two dimensions
  1594.             according to the parameters in ProjParams.  The two
  1595.             dimensional points are stored in OutArray.  The location of
  1596.             the viewer in this three dimensional space is given by EyeX,
  1597.             EyeY, EyeZ in the ProjParams structure.  The direction the
  1598.             viewer is facing is specified with ScrD, Theta, Phi in the
  1599.             ProjParams structure using spherical coordinates.  A virtual
  1600.             set of axes parallel to the true axes are placed at the
  1601.             viewer's location.  ScrD is the distance from the viewer to
  1602.             the center of the projection screen, i.e. the currently
  1603.             defined viewport on the monitor's screen.  Theta is the angle
  1604.             in the virtual X-Y plane from the virtual X axis to the
  1605.             projection screen.  Positive angles rotate clockwise in the X-
  1606.             Y plane.  Lastly, the angle of elevation above or below the
  1607.             virtual X-Y plane is given by Phi.  Positive angles direct
  1608.             viewing above the plane; negative below.
  1609.  
  1610.             If a point is projected to a location behind the viewer, i.e.
  1611.             on the side of the viewer opposite the projection screen,
  1612.             D3PROJECT returns a zero indicating one or more failed points.
  1613.             The returned values of the X and Y for failed points will be -
  1614.             32768 to make them easily identified.
  1615.  
  1616.             Arrays should be passed by giving the element within the array
  1617.             from where the action should take place.  This allows the
  1618.             programmer to store more than one item within the same array
  1619.             or act on only a portion of the array.
  1620.  
  1621.             SEE ALSO
  1622.  
  1623.             D3ROTATE, D3TRANSLATE, D3SCALE, SETVIEW
  1624.  
  1625.             EXAMPLE
  1626.  
  1627.             REM DRAW A CUBE AT THE CENTER OF THE SCREEN
  1628.             REM $INCLUDE: 'SVGABC.BI'
  1629.             DEFINT A-Z
  1630.             DIM CUBE(1 TO 8) AS P3DType
  1631.             DIM PLOT(1 TO 8) AS P2DType
  1632.             DIM PROJPARAMS AS PROJType
  1633.  
  1634.             CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
  1635.             CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
  1636.             CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
  1637.             CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
  1638.             CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
  1639.             CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
  1640.             CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
  1641.             CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
  1642.             VMODE = VIDEOMODEGET
  1643.             IF WHICHVGA = 0 THEN STOP
  1644.             DUMMY=RES640
  1645.  
  1646.  
  1647.                                                                          25
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.             PROJPARAMS.EYEX = -1040
  1654.             PROJPARAMS.EYEY = -600
  1655.             PROJPARAMS.EYEZ = -1200
  1656.             PROJPARAMS.SCRD = 1700
  1657.             PROJPARAMS.THETA = 30
  1658.             PROJPARAMS.PHI = 45
  1659.             DUMMY = D3PROJECT(8,PROJPARAMS.EYEX,CUBE(1).X,PLOT(1).X)
  1660.             GOSUB DRWCUBE
  1661.             WHILE INKEY$ = ""
  1662.             WEND
  1663.             VIDEOMODESET VMODE
  1664.             END
  1665.  
  1666.             DRWCUBE:
  1667.             FOR J=1 TO 3
  1668.             DRWLINE 1, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  1669.             NEXT J
  1670.             DRWLINE 1, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
  1671.             FOR J=5 TO 7
  1672.             DRWLINE 1, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  1673.             NEXT J
  1674.             DRWLINE 1, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
  1675.             FOR J=1 TO 4
  1676.             DRWLINE 1, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X, PLOT(J+4).Y
  1677.             NEXT J
  1678.             RETURN
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.                                                                          26
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.           D3ROTATE
  1716.  
  1717.             PROTOTYPE
  1718.  
  1719.             SUB D3ROTATE (NumPoints%, X%, Y%, Z%, AngleZ%, AngleY%,
  1720.             AngleX%, InArray%, OutArray%)
  1721.  
  1722.             INPUT
  1723.  
  1724.             NumPoints - number of points to be rotated
  1725.             X, Y, Z - center of rotation
  1726.             AngleZ - angle of rotation about the Z axis
  1727.             AngleY - angle of rotation about the Y axis
  1728.             AngleX - angle of rotation about the X axis
  1729.             InArray - P3DType array containing points to rotate
  1730.  
  1731.             OUTPUT
  1732.  
  1733.             no value returned
  1734.             OutArray - P3DType array holding rotated values
  1735.  
  1736.             USAGE
  1737.  
  1738.             D3ROTATE takes the three dimensional points given in InArray
  1739.             and rotates them by the specified angles about Xorigin,
  1740.             Yorigin, Zorigin.  The results are returned in OutArray which
  1741.             can be the same as InArray.  A virtual set of axes are placed
  1742.             at the origin of rotation and rotation takes place about these
  1743.             axes.  A positive angle causes a counter-clockwise rotation
  1744.             from the positive X axis to the positive Y axis.
  1745.  
  1746.             Arrays should be passed by giving the element within the array
  1747.             from where the action should take place.  This allows the
  1748.             programmer to store more than one item within the same array
  1749.             or act on only a portion of the array.
  1750.  
  1751.             SEE ALSO
  1752.  
  1753.             D3PROJECT, D3SCALE, D3TRANSLATE
  1754.  
  1755.             EXAMPLE
  1756.  
  1757.             REM ROTATE A CUBE AT THE CENTER OF THE SCREEN
  1758.             REM $INCLUDE: 'SVGABC.BI'
  1759.             DEFINT A-Z
  1760.             DIM CUBE(1 TO 8) AS P3DType
  1761.             DIM RCUBE(1 TO 8) AS P3DType
  1762.             DIM PLOT(1 TO 8) AS P2DType
  1763.             DIM PROJPARAMS AS PROJType
  1764.  
  1765.             CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
  1766.             CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
  1767.             CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
  1768.             CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
  1769.  
  1770.  
  1771.                                                                          27
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.             CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
  1778.             CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
  1779.             CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
  1780.             CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
  1781.             VMODE = VIDEOMODEGET
  1782.             IF WHICHVGA = 0 THEN STOP
  1783.             DUMMY=RES640
  1784.             PROJPARAMS.EYEX = -1040
  1785.             PROJPARAMS.EYEY = -600
  1786.             PROJPARAMS.EYEZ = -1200
  1787.             PROJPARAMS.SCRD = 1700
  1788.             PROJPARAMS.THETA = 30
  1789.             PROJPARAMS.PHI = 45
  1790.             FOR I = 0 TO 360 STEP 5
  1791.             D3ROTATE 8, 0, 0, 0, I, I, I, CUBE(1).X, RCUBE(1).X
  1792.             DUMMY = D3PROJECT(8,PROJPARAMS.EYEX,RCUBE(1).X,PLOT(1).X)
  1793.             GOSUB DRWCUBE
  1794.             SDELAY 2
  1795.             GOSUB DRWCUBE
  1796.             NEXT I
  1797.             WHILE INKEY$ = ""
  1798.             WEND
  1799.             VIDEOMODESET VMODE
  1800.             END
  1801.  
  1802.             DRWCUBE:
  1803.             FOR J=1 TO 3
  1804.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  1805.             NEXT J
  1806.             DRWLINE 2, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
  1807.             FOR J=5 TO 7
  1808.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  1809.             NEXT J
  1810.             DRWLINE 2, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
  1811.             FOR J=1 TO 4
  1812.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X, PLOT(J+4).Y
  1813.             NEXT J
  1814.             RETURN
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.                                                                          28
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.           D3SCALE
  1840.  
  1841.             PROTOTYPE
  1842.  
  1843.             SUB D3SCALE (NumPoints%, ScaleX%, ScaleY%, ScaleZ%, InArray%,
  1844.             OutArray%)
  1845.  
  1846.             INPUT
  1847.  
  1848.             NumPoints - number of points to scale
  1849.             ScaleX - scale factor along X axis
  1850.             ScaleY - scale factor along Y axis
  1851.             ScaleZ - scale factor along Z axis
  1852.             InArray - P3DType array containing points to scale
  1853.  
  1854.             OUTPUT
  1855.  
  1856.             no value returned
  1857.             OutArray - P3DType array holding scaled values
  1858.  
  1859.             USAGE
  1860.  
  1861.             D3SCALE multiplies each coordinate in the three dimensional
  1862.             array InArray by the corresponding scale factor ScaleX, ScaleY
  1863.             or ScaleZ.  The results are stored in OutArray which can be
  1864.             the same as InArray.  A scale factor of 256 (100 hex) is
  1865.             considered 100 percent and results in no change.  Therefore,
  1866.             128 (80 hex) reduces values by one half and 512 (200 hex)
  1867.             doubles values.
  1868.  
  1869.             Arrays should be passed by giving the element within the array
  1870.             from where the action should take place.  This allows the
  1871.             programmer to store more than one item within the same array
  1872.             or act on only a portion of the array.
  1873.  
  1874.             SEE ALSO
  1875.  
  1876.             D3PROJECT, D3ROTATE, D3TRANSLATE
  1877.  
  1878.             EXAMPLE
  1879.  
  1880.             REM SCALE A CUBE AT THE CENTER OF THE SCREEN
  1881.             REM $INCLUDE: 'SVGABC.BI'
  1882.             DEFINT A-Z
  1883.             DIM CUBE(1 TO 8) AS P3DType
  1884.             DIM SCUBE(1 TO 8) AS P3DType
  1885.             DIM PLOT(1 TO 8) AS P2DType
  1886.             DIM PROJPARAMS AS PROJType
  1887.  
  1888.             CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
  1889.             CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
  1890.             CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
  1891.             CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
  1892.             CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
  1893.  
  1894.  
  1895.                                                                          29
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.             CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
  1902.             CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
  1903.             CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
  1904.             VMODE = VIDEOMODEGET
  1905.             IF WHICHVGA = 0 THEN STOP
  1906.             DUMMY=RES640
  1907.             PROJPARAMS.EYEX = -1040
  1908.             PROJPARAMS.EYEY = -600
  1909.             PROJPARAMS.EYEZ = -1200
  1910.             PROJPARAMS.SCRD = 1700
  1911.             PROJPARAMS.THETA = 30
  1912.             PROJPARAMS.PHI = 45
  1913.             FOR I = 256 TO 128 STEP -4
  1914.             D3SCALE 8, I, I, I, CUBE(1).X, SCUBE(1).X
  1915.             DUMMY = D3PROJECT(8,PROJPARAMS.EYEX,SCUBE(1).X,PLOT(1).X)
  1916.             GOSUB DRWCUBE
  1917.             SDELAY 2
  1918.             GOSUB DRWCUBE
  1919.             NEXT I
  1920.             FOR I = 132 TO 256 STEP 4
  1921.             D3SCALE 8, I, I, I, CUBE(1).X, SCUBE(1).X
  1922.             DUMMY = D3PROJECT(8,PROJPARAMS.EYEX,SCUBE(1).X,PLOT(1).X)
  1923.             GOSUB DRWCUBE
  1924.             SDELAY 2
  1925.             GOSUB DRWCUBE
  1926.             NEXT I
  1927.             WHILE INKEY$ = ""
  1928.             WEND
  1929.             VIDEOMODESET VMODE
  1930.             END
  1931.  
  1932.             DRWCUBE:
  1933.             FOR J=1 TO 3
  1934.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  1935.             NEXT J
  1936.             DRWLINE 2, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
  1937.             FOR J=5 TO 7
  1938.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  1939.             NEXT J
  1940.             DRWLINE 2, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
  1941.             FOR J=1 TO 4
  1942.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X, PLOT(J+4).Y
  1943.             NEXT J
  1944.             RETURN
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.                                                                          30
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.           D3TRANSLATE
  1964.  
  1965.             PROTOTYPE
  1966.  
  1967.             SUB D3TRANSLATE (NumPoints%, TransX%, TransY%, TransZ%,
  1968.             InArray%, OutArray%)
  1969.  
  1970.             INPUT
  1971.  
  1972.             NumPoints - number of points to translate
  1973.             TransX - distance to translate along X axis
  1974.             TransY - distance to translate along Y axis
  1975.             TransZ - distance to translate along Z axis
  1976.             InArray - P3DType array containing points to translate
  1977.  
  1978.             OUTPUT
  1979.  
  1980.             no value returned
  1981.             OutArray - P3DType array holding translated points
  1982.  
  1983.             USAGE
  1984.  
  1985.             D3TRANSLATE takes the three dimensional points given in
  1986.             InArray and translates them by the specified number of pixels
  1987.             along each axis.  The results are returned in OutArray which
  1988.             can be the same as InArray.
  1989.  
  1990.             Arrays should be passed by giving the element within the array
  1991.             from where the action should take place.  This allows the
  1992.             programmer to store more than one item within the same array
  1993.             or act on only a portion of the array.
  1994.  
  1995.             SEE ALSO
  1996.  
  1997.             D3PROJECT, D3ROTATE, D3SCALE
  1998.  
  1999.             EXAMPLE
  2000.  
  2001.             REM TRANSLATE A CUBE NEAR THE CENTER OF THE SCREEN
  2002.             REM $INCLUDE: 'SVGABC.BI'
  2003.             DEFINT A-Z
  2004.             DIM CUBE(1 TO 8) AS P3DType
  2005.             DIM TCUBE(1 TO 8) AS P3DType
  2006.             DIM PLOT(1 TO 8) AS P2DType
  2007.             DIM PROJPARAMS AS PROJType
  2008.  
  2009.             CUBE(1).X =  100 : CUBE(1).Y = -100 : CUBE(1).Z =  100
  2010.             CUBE(2).X =  100 : CUBE(2).Y = -100 : CUBE(2).Z = -100
  2011.             CUBE(3).X =  100 : CUBE(3).Y =  100 : CUBE(3).Z = -100
  2012.             CUBE(4).X =  100 : CUBE(4).Y =  100 : CUBE(4).Z =  100
  2013.             CUBE(5).X = -100 : CUBE(5).Y = -100 : CUBE(5).Z =  100
  2014.             CUBE(6).X = -100 : CUBE(6).Y = -100 : CUBE(6).Z = -100
  2015.             CUBE(7).X = -100 : CUBE(7).Y =  100 : CUBE(7).Z = -100
  2016.             CUBE(8).X = -100 : CUBE(8).Y =  100 : CUBE(8).Z =  100
  2017.  
  2018.  
  2019.                                                                          31
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.             VMODE = VIDEOMODEGET
  2026.             IF WHICHVGA = 0 THEN STOP
  2027.             DUMMY=RES640
  2028.             PROJPARAMS.EYEX = -1040
  2029.             PROJPARAMS.EYEY = -600
  2030.             PROJPARAMS.EYEZ = -1200
  2031.             PROJPARAMS.SCRD = 1700
  2032.             PROJPARAMS.THETA = 30
  2033.             PROJPARAMS.PHI = 45
  2034.             FOR I = 0 TO 100 STEP 2
  2035.             D3TRANSLATE 8, I, I, I, CUBE(1).X, TCUBE(1).X
  2036.             DUMMY = D3PROJECT(8,PROJPARAMS.EYEX,TCUBE(1).X,PLOT(1).X)
  2037.             GOSUB DRWCUBE
  2038.             SDELAY 2
  2039.             GOSUB DRWCUBE
  2040.             NEXT I
  2041.             FOR I = 98 TO 0 STEP -2
  2042.             D3TRANSLATE 8, I, I, I, CUBE(1).X, TCUBE(1).X
  2043.             DUMMY = D3PROJECT(8,PROJPARAMS.EYEX,TCUBE(1).X,PLOT(1).X)
  2044.             GOSUB DRWCUBE
  2045.             SDELAY 2
  2046.             GOSUB DRWCUBE
  2047.             NEXT I
  2048.             WHILE INKEY$ = ""
  2049.             WEND
  2050.             VIDEOMODESET VMODE
  2051.             END
  2052.  
  2053.             DRWCUBE:
  2054.             FOR J=1 TO 3
  2055.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  2056.             NEXT J
  2057.             DRWLINE 2, 10, PLOT(4).X, PLOT(4).Y, PLOT(1).X, PLOT(1).Y
  2058.             FOR J=5 TO 7
  2059.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+1).X, PLOT(J+1).Y
  2060.             NEXT J
  2061.             DRWLINE 2, 10, PLOT(8).X, PLOT(8).Y, PLOT(5).X, PLOT(5).Y
  2062.             FOR J=1 TO 4
  2063.             DRWLINE 2, 10, PLOT(J).X, PLOT(J).Y, PLOT(J+4).X, PLOT(J+4).Y
  2064.             NEXT J
  2065.             RETURN
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.                                                                          32
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.           DRWBOX
  2088.  
  2089.             PROTOTYPE
  2090.  
  2091.             SUB DRWBOX (Mode%, Color%, X1%, Y1%, X2%, Y2%)
  2092.  
  2093.             INPUT
  2094.  
  2095.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2096.             Color - index to color in current palette
  2097.             X1, Y1 - location of top left corner
  2098.             X2, Y2 - location of bottom right corner
  2099.  
  2100.             OUTPUT
  2101.  
  2102.             no value returned
  2103.  
  2104.             USAGE
  2105.  
  2106.             DRWBOX draws a rectangle of the color specified using Mode
  2107.             with opposite vertices defined by (X1, Y1) and (X2, Y2).  The
  2108.             vertices given do not need to be exactly the top left and
  2109.             bottom right.  They only have to reference opposite sides of
  2110.             the rectangle.  Any portion of the rectangle that lies outside
  2111.             of the currently defined viewport will not be drawn.
  2112.  
  2113.             SEE ALSO
  2114.  
  2115.             DRWFILLBOX, DRWLINE, SETVIEW
  2116.  
  2117.             EXAMPLE
  2118.  
  2119.             REM DRAWS A BOX AROUND THE WHOLE SCREEN
  2120.             REM $INCLUDE: 'SVGABC.BI'
  2121.             DEFINT A-Z
  2122.  
  2123.             VMODE=VIDEOMODEGET
  2124.             IF WHICHVGA = 0 THEN STOP
  2125.             DUMMY=RES640
  2126.             DRWBOX 1, 10, 0, 0, 639, 479
  2127.             WHILE INKEY$ = ""
  2128.             WEND
  2129.             VIDEOMODESET VMODE
  2130.             END
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.                                                                          33
  2144.  
  2145.  
  2146.  
  2147.  
  2148.  
  2149.           DRWCIRCLE
  2150.  
  2151.             PROTOTYPE
  2152.  
  2153.             SUB DRWCIRCLE (Mode%, Color%, Xcenter%, Ycenter%, Radius%)
  2154.  
  2155.             INPUT
  2156.  
  2157.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2158.             Color - index to color in current palette
  2159.             Xcenter, Ycenter - location of center of circle
  2160.             Radius - distance from center to edge of circle
  2161.  
  2162.             OUTPUT
  2163.  
  2164.             no value returned
  2165.  
  2166.             USAGE
  2167.  
  2168.             DRWCIRCLE draws a circle of the specified color using Mode
  2169.             with the center located at (Xcenter, Ycenter) and a radius of
  2170.             Radius.  All values of Xcenter, Ycenter and Radius are valid.
  2171.             Any portion of the circle that lies outside of the currently
  2172.             defined viewport will not be drawn.
  2173.  
  2174.             SEE ALSO
  2175.  
  2176.             DRWELLIPSE, DRWFILLCIRCLE, SETVIEW
  2177.  
  2178.             EXAMPLE
  2179.  
  2180.             REM DRAWS A CIRCLE AT THE CENTER OF THE SCREEN
  2181.             REM $INCLUDE: 'SVGABC.BI'
  2182.             DEFINT A-Z
  2183.  
  2184.             VMODE=VIDEOMODEGET
  2185.             IF WHICHVGA = 0 THEN STOP
  2186.             DUMMY=RES640
  2187.             DRWCIRCLE 1, 10, 320, 240, 200
  2188.             WHILE INKEY$ = ""
  2189.             WEND
  2190.             VIDEOMODESET VMODE
  2191.             END
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.                                                                          34
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.           DRWELLIPSE
  2212.  
  2213.             PROTOTYPE
  2214.  
  2215.             SUB DRWELLIPSE (Mode%, Color%, Xcenter%, Ycenter%, RadiusX%,
  2216.             RadiusY%)
  2217.  
  2218.             INPUT
  2219.  
  2220.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2221.             Color - index to color in current palette
  2222.             Xcenter, Ycenter - location of center of ellipse
  2223.             RadiusX - radius parallel to X axis
  2224.             RadiusY - radius parallel to Y axis
  2225.  
  2226.             OUTPUT
  2227.  
  2228.             no value returned
  2229.  
  2230.             USAGE
  2231.  
  2232.             DRWELLIPSE draws an ellipse of the specified color using Mode
  2233.             with the center defined by (Xcenter, Ycenter).  The radius in
  2234.             the horizontal direction is RaduisX and the radius in the
  2235.             vertical direction is RadiusY.  All values of Xcenter,
  2236.             Ycenter, RadiusX and RadiusY are valid.  Any portion of the
  2237.             ellipse that lies outside of the currently defined viewport
  2238.             will not be drawn.
  2239.  
  2240.             SEE ALSO
  2241.  
  2242.             DRWCIRCLE, DRWFILLELLIPSE, SETVIEW
  2243.  
  2244.             EXAMPLE
  2245.  
  2246.             REM DRAWS AN ELLIPSE AT THE CENTER OF THE SCREEN
  2247.             REM $INCLUDE: 'SVGABC.BI'
  2248.             DEFINT A-Z
  2249.  
  2250.             VMODE=VIDEOMODEGET
  2251.             IF WHICHVGA = 0 THEN STOP
  2252.             DUMMY=RES640
  2253.             DRWELLIPSE 1, 10, 320, 240, 318, 238
  2254.             WHILE INKEY$ = ""
  2255.             WEND
  2256.             VIDEOMODESET VMODE
  2257.             END
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.                                                                          35
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.           DRWFILLBOX
  2274.  
  2275.             PROTOTYPE
  2276.  
  2277.             SUB DRWFILLBOX (Mode%, Color%, X1%, Y1%, X2%, Y2%)
  2278.  
  2279.             INPUT
  2280.  
  2281.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2282.             Color - index to color in current palette
  2283.             X1, Y1 - location of top left corner
  2284.             X2, Y2 - location of bottom right corner
  2285.  
  2286.             OUTPUT
  2287.  
  2288.             no value returned
  2289.  
  2290.             USAGE
  2291.  
  2292.             DRWBOX draws a filled rectangle of the color specified using
  2293.             Mode with opposite vertices defined by (X1, Y1) and (X2, Y2).
  2294.             The vertices given do not need to be exactly the top left and
  2295.             bottom right.  They only have to reference opposite sides of
  2296.             the rectangle.  Any portion of the rectangle that lies outside
  2297.             of the currently defined viewport will not be drawn.
  2298.  
  2299.             SEE ALSO
  2300.  
  2301.             DRWBOX, DRWLINE, SETVIEW
  2302.  
  2303.             EXAMPLE
  2304.  
  2305.             REM DRAWS A FILLED BOX
  2306.             REM $INCLUDE: 'SVGABC.BI'
  2307.             DEFINT A-Z
  2308.  
  2309.             VMODE = VIDEOMODEGET
  2310.             IF WHICHVGA = 0 THEN STOP
  2311.             DUMMY = RES640
  2312.             DRWFILLBOX 1, 10, 100, 100, 200, 200
  2313.             WHILE INKEY$ = ""
  2314.             WEND
  2315.             VIDEOMODESET VMODE
  2316.             END
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.                                                                          36
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.           DRWFILLCIRCLE
  2336.  
  2337.             PROTOTYPE
  2338.  
  2339.             SUB DRWFILLCIRCLE (Mode%, Color%, Xcenter%, Ycenter%, Radius%)
  2340.  
  2341.             INPUT
  2342.  
  2343.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2344.             Color - index to color in current palette
  2345.             Xcenter, Ycenter - location of center of circle
  2346.             Radius - distance from center to edge of circle
  2347.  
  2348.             OUTPUT
  2349.  
  2350.             no value returned
  2351.  
  2352.             USAGE
  2353.  
  2354.             DRWCIRCLE draws a filled circle of the specified color using
  2355.             Mode with the center located at (Xcenter, Ycenter) and a
  2356.             radius of Radius.  All values of Xcenter, Ycenter and Radius
  2357.             are valid.  Any portion of the circle that lies outside of the
  2358.             currently defined viewport will not be drawn.
  2359.  
  2360.             SEE ALSO
  2361.  
  2362.             DRWCIRCLE, SETVIEW
  2363.  
  2364.             EXAMPLE
  2365.  
  2366.             REM DRAWS A FILLED CIRCLE
  2367.             REM $INCLUDE: 'SVGABC.BI'
  2368.             DEFINT A-Z
  2369.  
  2370.             VMODE = VIDEOMODEGET
  2371.             IF WHICHVGA = 0 THEN STOP
  2372.             DUMMY = RES640
  2373.             DRWFILLCIRCLE 1, 10, 320, 240, 50
  2374.             WHILE INKEY$ = ""
  2375.             WEND
  2376.             VIDEOMODESET VMODE
  2377.             END
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.                                                                          37
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.           DRWFILLELLIPSE
  2398.  
  2399.             PROTOTYPE
  2400.  
  2401.             SUB DRWFILLELLIPSE (Mode%, Color%, Xcenter%, Ycenter%,
  2402.             RadiusX%, RadiusY%)
  2403.  
  2404.             INPUT
  2405.  
  2406.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2407.             Color - index to color in current palette
  2408.             Xcenter, Ycenter - location of center of ellipse
  2409.             RadiusX - radius parallel to X axis
  2410.             RadiusY - radius parallel to Y axis
  2411.  
  2412.             OUTPUT
  2413.  
  2414.             no value returned
  2415.  
  2416.             USAGE
  2417.  
  2418.             DRWELLIPSE draws a filled ellipse of the specified color using
  2419.             Mode with the center defined by (Xcenter, Ycenter).  The
  2420.             radius in the horizontal direction is RaduisX and the radius
  2421.             in the vertical direction is RadiusY.  All values of Xcenter,
  2422.             Ycenter, RadiusX and RadiusY are valid.  Any portion of the
  2423.             ellipse that lies outside of the currently defined viewport
  2424.             will not be drawn.
  2425.  
  2426.             SEE ALSO
  2427.  
  2428.             DRWELLIPSE, SETVIEW
  2429.  
  2430.             EXAMPLE
  2431.  
  2432.             REM DRAWS A FILLED ELLIPSE
  2433.             REM $INCLUDE: 'SVGABC.BI'
  2434.             DEFINT A-Z
  2435.  
  2436.             VMODE = VIDEOMODEGET
  2437.             IF WHICHVGA = 0 THEN STOP
  2438.             DUMMY = RES640
  2439.             DRWFILLELLIPSE 1, 10, 320, 240, 118, 50
  2440.             WHILE INKEY$ = ""
  2441.             WEND
  2442.             VIDEOMODESET VMODE
  2443.             END
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.                                                                          38
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.           DRWLINE
  2460.  
  2461.             PROTOTYPE
  2462.  
  2463.             SUB DRWLINE (Mode%, Color%, X1%, Y1%, X2%, Y2%)
  2464.  
  2465.             INPUT
  2466.  
  2467.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2468.             Color - index to color in current palette
  2469.             X1, Y1 - location of one endpoint of line
  2470.             X2, Y2 - location of other endpoint of line
  2471.  
  2472.             OUTPUT
  2473.  
  2474.             no value returned
  2475.  
  2476.             USAGE
  2477.  
  2478.             DRWLINE draws a line of the specified color using Mode with
  2479.             endpoints located at (X1, Y1) and (X2, Y2).  All values of X1,
  2480.             Y1, X2 and Y2 are valid.  Any portion of the line that lies
  2481.             outside of the currently defined viewport will not be drawn.
  2482.  
  2483.             SEE ALSO
  2484.  
  2485.             DRWBOX, SETVIEW
  2486.  
  2487.             EXAMPLE
  2488.  
  2489.             REM DRAWS A LINE FROM 0,0 TO THE CENTER OF THE SCREEN
  2490.             REM $INCLUDE: 'SVGABC.BI'
  2491.             DEFINT A-Z
  2492.  
  2493.             VMODE=VIDEOMODEGET
  2494.             IF WHICHVGA = 0 THEN STOP
  2495.             DUMMY=RES640
  2496.             DRWLINE 1, 10, 0, 0, 320, 240
  2497.             WHILE INKEY$ = ""
  2498.             WEND
  2499.             VIDEOMODESET VMODE
  2500.             END
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.                                                                          39
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.           DRWPOINT
  2522.  
  2523.             PROTOTYPE
  2524.  
  2525.             SUB DRWPOINT (Mode%, Color%, X%, Y%)
  2526.  
  2527.             INPUT
  2528.  
  2529.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  2530.             Color - index to color in current palette
  2531.             X, Y - location of pixel to write
  2532.  
  2533.             OUTPUT
  2534.  
  2535.             no value returned
  2536.  
  2537.             USAGE
  2538.  
  2539.             DRWPOINT draws a single point of the specified color using
  2540.             Mode at (X, Y).  All values of X and Y are valid.  If the
  2541.             point (X, Y) lies outside of the currently defined viewport,
  2542.             no drawing will take place.
  2543.  
  2544.             SEE ALSO
  2545.  
  2546.             GETPOINT, SETVIEW
  2547.  
  2548.             EXAMPLE
  2549.  
  2550.             REM DRAWS A POINT AT THE CENTER OF THE SCREEN
  2551.             REM $INCLUDE: 'SVGABC.BI'
  2552.             DEFINT A-Z
  2553.  
  2554.             VMODE=VIDEOMODEGET
  2555.             IF WHICHVGA = 0 THEN STOP
  2556.             DUMMY=RES640
  2557.             DRWPOINT 1, 10, 320, 240
  2558.             WHILE INKEY$ = ""
  2559.             WEND
  2560.             VIDEOMODESET VMODE
  2561.             END
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.                                                                          40
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.           DRWSTRING
  2584.  
  2585.             PROTOTYPE
  2586.  
  2587.             SUB DRWSTRING (Mode%, FColor%, BColor%, Strng$, X%, Y%)
  2588.  
  2589.             INPUT
  2590.  
  2591.             Mode - pixel write mode (no action=0, SET=1, XOR=2, OR=3,
  2592.             AND=4)
  2593.             FColor - foreground index to color in current palette
  2594.             BColor - background index to color in current palette
  2595.             Strng$ - string of ASCII characters to be drawn
  2596.             X, Y - location of upper, left corner of block
  2597.  
  2598.             OUTPUT
  2599.  
  2600.             no value returned
  2601.  
  2602.             USAGE
  2603.  
  2604.             DRWSTRING takes the ASCII characters contained in Strng$ and
  2605.             creates a graphics block similar to the blocks used by Blkget
  2606.             and Blkput and places this block on the screen at the
  2607.             specified coordinates.  The characters are drawn with color
  2608.             FColor using the current font and the background is color
  2609.             BColor.  When mode 0, no action, is used, the graphics block
  2610.             is created in memory retrievable by GETLASTSTRING, but no text
  2611.             is actually drawn on the screen.  (Note: the system font is
  2612.             automatically installed when WHICHVGA is called.)
  2613.  
  2614.             SEE ALSO
  2615.  
  2616.             FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRINGDN, DRWSTRINGLT,
  2617.             DRWSTRINGRT, GETLASTSTRING
  2618.  
  2619.             EXAMPLE
  2620.  
  2621.             REM DRAWS SOME NORMAL TEXT AT THE CENTER OF THE SCREEN
  2622.             REM $INCLUDE: 'SVGABC.BI'
  2623.             DEFINT A-Z
  2624.  
  2625.             VMODE=VIDEOMODEGET
  2626.             IF WHICHVGA = 0 THEN STOP
  2627.             DUMMY=RES640
  2628.             A$ = "HELLO WORLD"
  2629.             DRWSTRING 1, 10, 0, A$, 320, 240
  2630.             WHILE INKEY$ = ""
  2631.             WEND
  2632.             VIDEOMODESET VMODE
  2633.             END
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.                                                                          41
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.           DRWSTRINGDN
  2646.  
  2647.             PROTOTYPE
  2648.  
  2649.             SUB DRWSTRINGDN (Mode%, FColor%, BColor%, Strng$, X%, Y%)
  2650.  
  2651.             INPUT
  2652.  
  2653.             Mode - pixel write mode (no action=0, SET=1, XOR=2, OR=3,
  2654.             AND=4)
  2655.             FColor - foreground index to color in current palette
  2656.             BColor - background index to color in current palette
  2657.             Strng$ - string of ASCII characters to be drawn
  2658.             X, Y - location of lower, right corner of block
  2659.  
  2660.             OUTPUT
  2661.  
  2662.             no value returned
  2663.  
  2664.             USAGE
  2665.  
  2666.             DRWSTRINGDN takes the ASCII characters contained in Strng$ and
  2667.             creates a graphics block similar to the blocks used by Blkget
  2668.             and Blkput.  The characters are drawn with color FColor using
  2669.             the current font and the background is color BColor.  When
  2670.             mode 0, no action, is used, the graphics block is created in
  2671.             memory retrievable by GETLASTSTRING, but no text is actually
  2672.             drawn on the screen.  (Note: the system font is automatically
  2673.             installed when WHICHVGA is called.)  The text is drawn upside
  2674.             down with X, Y specifying the lower, right corner.  This
  2675.             corner corresponds to the upper, left corner when the text is
  2676.             oriented upright.
  2677.  
  2678.             SEE ALSO
  2679.  
  2680.             FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRING, DRWSTRINGLT,
  2681.             DRWSTRINGRT, GETLASTSTRING
  2682.  
  2683.             EXAMPLE
  2684.  
  2685.             REM DRAWS SOME UP-SIDE-DOWN TEXT AT THE CENTER OF THE SCREEN
  2686.             REM $INCLUDE: 'SVGABC.BI'
  2687.             DEFINT A-Z
  2688.  
  2689.             VMODE=VIDEOMODEGET
  2690.             IF WHICHVGA = 0 THEN STOP
  2691.             DUMMY=RES640
  2692.             A$ = "HELLO WORLD"
  2693.             DRWSTRINGDN 1, 10, 0, A$, 320, 240
  2694.             WHILE INKEY$ = ""
  2695.             WEND
  2696.             VIDEOMODESET VMODE
  2697.             END
  2698.  
  2699.  
  2700.  
  2701.                                                                          42
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.           DRWSTRINGLT
  2708.  
  2709.             PROTOTYPE
  2710.  
  2711.             SUB DRWSTRINGLT (Mode%, FColor%, BColor%, Strng$, X%, Y%)
  2712.  
  2713.             INPUT
  2714.  
  2715.             Mode - pixel write mode (no action=0, SET=1, XOR=2, OR=3,
  2716.             AND=4)
  2717.             FColor - foreground index to color in current palette
  2718.             BColor - background index to color in current palette
  2719.             Strng$ - string of ASCII characters to be drawn
  2720.             X, Y - location of lower, left corner of block
  2721.  
  2722.             OUTPUT
  2723.  
  2724.             no value returned
  2725.  
  2726.             USAGE
  2727.  
  2728.             DRWSTRINGLT takes the ASCII characters contained in Strng$ and
  2729.             creates a graphics block similar to the blocks used by Blkget
  2730.             and Blkput.  The characters are drawn with color FColor using
  2731.             the current font and the background is color BColor.  When
  2732.             mode 0, no action, is used, the graphics block is created in
  2733.             memory retrievable by GETLASTSTRING, but no text is actually
  2734.             drawn on the screen.  (Note: the system font is automatically
  2735.             installed when WHICHVGA is called.)  The text block is rotated
  2736.             90 to the left with X, Y specifying the lower, left corner.
  2737.             This corner corresponds to the upper, left corner when the
  2738.             text is oriented upright.
  2739.  
  2740.  
  2741.             SEE ALSO
  2742.  
  2743.             FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRING, DRWSTRINGDN,
  2744.             DRWSTRINGRT, GETLASTSTRING
  2745.  
  2746.             EXAMPLE
  2747.  
  2748.             REM DRAWS SOME TEXT ROTATED BY 90 DEGREES TO THE LEFT AT THE
  2749.             REM CENTER OF THE SCREEN
  2750.             REM $INCLUDE: 'SVGABC.BI'
  2751.             DEFINT A-Z
  2752.  
  2753.             VMODE=VIDEOMODEGET
  2754.             IF WHICHVGA = 0 THEN STOP
  2755.             DUMMY=RES640
  2756.             A$ = "HELLO WORLD"
  2757.             DRWSTRINGLT 1, 10, 0, A$, 320, 240
  2758.             WHILE INKEY$ = ""
  2759.             WEND
  2760.             VIDEOMODESET VMODE
  2761.  
  2762.  
  2763.                                                                          43
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.             END
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.                                                                          44
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.           DRWSTRINGRT
  2832.  
  2833.             PROTOTYPE
  2834.  
  2835.             SUB DRWSTRINGRT (Mode%, FColor%, BColor%, Strng$, X%, Y%)
  2836.  
  2837.             INPUT
  2838.  
  2839.             Mode - pixel write mode (no action=0, SET=1, XOR=2, OR=3,
  2840.             AND=4)
  2841.             FColor - foreground index to color in current palette
  2842.             BColor - background index to color in current palette
  2843.             Strng$ - string of ASCII characters to be drawn
  2844.             X, Y - location of upper, right corner of block
  2845.  
  2846.             OUTPUT
  2847.  
  2848.             no value returned
  2849.  
  2850.             USAGE
  2851.  
  2852.             DRWSTRINGRT takes the ASCII characters contained in Strng$ and
  2853.             creates a graphics block similar to the blocks used by Blkget
  2854.             and Blkput.  The characters are drawn with color FColor using
  2855.             the current font and the background is color BColor.  When
  2856.             mode 0, no action, is used, the graphics block is created in
  2857.             memory retrievable by GETLASTSTRING, but no text is actually
  2858.             drawn on the screen.  (Note: the system font is automatically
  2859.             installed when WHICHVGA is called.)  The text block is rotated
  2860.             90 to the right with X, Y specifying the upper, right corner.
  2861.             This corner corresponds to the upper, left corner if the text
  2862.             is oriented upright.
  2863.  
  2864.  
  2865.             SEE ALSO
  2866.  
  2867.             FONTSET, FONTGETINFO, FONTSYSTEM, DRWSTRING, DRWSTRINGDN,
  2868.             DRWSTRINGLT, GETLASTSTRING
  2869.  
  2870.             EXAMPLE
  2871.  
  2872.             REM DRAWS SOME TEXT ROTATED BY 90 DEGREES TO THE RIGHT AT THE
  2873.             REM CENTER OF THE SCREEN
  2874.             REM $INCLUDE: 'SVGABC.BI'
  2875.             DEFINT A-Z
  2876.  
  2877.             VMODE=VIDEOMODEGET
  2878.             IF WHICHVGA = 0 THEN STOP
  2879.             DUMMY=RES640
  2880.             A$ = "HELLO WORLD"
  2881.             DRWSTRINGRT 1, 10, 0, A$, 320, 240
  2882.             WHILE INKEY$ = ""
  2883.             WEND
  2884.             VIDEOMODESET VMODE
  2885.  
  2886.  
  2887.                                                                          45
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.             END
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.                                                                          46
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.           FILLAREA
  2956.  
  2957.             PROTOTYPE
  2958.  
  2959.             SUB FILLAREA (XSeed%, YSeed%, BorderColor%, FillColor%)
  2960.  
  2961.             INPUT
  2962.  
  2963.             XSeed, YSeed - seed location to start fill
  2964.             BorderColor - index to color in current palette at which
  2965.             filling stops
  2966.             FillColor - index to color in current palette to fill within
  2967.             the border
  2968.  
  2969.             OUTPUT
  2970.  
  2971.             no value returned
  2972.  
  2973.             USAGE
  2974.  
  2975.             FILLAREA fills a region with a new color specified by
  2976.             FillColor.  The region is defined by any line or curve of the
  2977.             color BorderColor or by the edge of the viewport.  All
  2978.             graphics within the region are lost and covered with the
  2979.             FillColor.  The border is not effected.
  2980.  
  2981.             SEE ALSO
  2982.  
  2983.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLCOLOR,
  2984.             FILLPAGE, FILLSCREEN, FILLVIEW, SETVIEW
  2985.  
  2986.             EXAMPLE
  2987.  
  2988.             REM FILLS A BOX WITH A COLOR
  2989.             REM $INCLUDE: 'SVGABC.BI'
  2990.             DEFINT A-Z
  2991.  
  2992.             VMODE=VIDEOMODEGET
  2993.             IF WHICHVGA = 0 THEN STOP
  2994.             DUMMY=RES640
  2995.             DRWBOX 1, 10, 0, 0, 100, 100
  2996.             FILLAREA 1, 1, 10, 7
  2997.             WHILE INKEY$ = ""
  2998.             WEND
  2999.             VIDEOMODESET VMODE
  3000.             END
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.                                                                          47
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.           FILLCOLOR
  3018.  
  3019.             PROTOTYPE
  3020.  
  3021.             SUB FILLCOLOR (XSeed%, YSeed%, OldColor%, NewColor%)
  3022.  
  3023.             INPUT
  3024.  
  3025.             XSeed, YSeed - seed location to start fill
  3026.             OldColor - index to color in current palette to change
  3027.             NewColor - index to color in current palette to replace
  3028.             OldColor
  3029.  
  3030.             OUTPUT
  3031.  
  3032.             no value returned
  3033.  
  3034.             USAGE
  3035.  
  3036.             FILLCOLOR replaces every existence of OldColor with NewColor
  3037.             within a region.  The region is defined as any pixel of
  3038.             OldColor which has a path of pixels of OldColor or NewColor
  3039.             with sides touching back to the seed point, (XSeed, YSeed).
  3040.             Therefore, only pixels of OldColor are modified and no other
  3041.             information is changed.
  3042.  
  3043.             SEE ALSO
  3044.  
  3045.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA, FILLPAGE,
  3046.             FILLSCREEN, FILLVIEW, SETVIEW
  3047.  
  3048.             EXAMPLE
  3049.  
  3050.             REM REPLACES THE BLACK COLOR WITH A NEW COLOR
  3051.             REM $INCLUDE: 'SVGABC.BI'
  3052.             DEFINT A-Z
  3053.  
  3054.             VMODE=VIDEOMODEGET
  3055.             IF WHICHVGA = 0 THEN STOP
  3056.             DUMMY=RES640
  3057.             DRWBOX 1, 10, 0, 0, 100, 100
  3058.             DRWBOX 1, 12, 20, 20, 80, 80
  3059.             FILLCOLOR 1, 1, 0, 7
  3060.             WHILE INKEY$ = ""
  3061.             WEND
  3062.             VIDEOMODESET VMODE
  3063.             END
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.                                                                          48
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.           FILLPAGE
  3080.  
  3081.             PROTOTYPE
  3082.  
  3083.             SUB FILLPAGE (Color%)
  3084.  
  3085.             INPUT
  3086.  
  3087.             Color - index to color in current palette
  3088.  
  3089.             OUTPUT
  3090.  
  3091.             no value returned
  3092.  
  3093.             USAGE
  3094.  
  3095.             FILLPAGE clears the currently active page with the specified
  3096.             color.  All information on the page is lost.  (Note, a faster
  3097.             method to clear the page is to call any of the 'RES###'
  3098.             functions.  These reset the graphics screen and automatically
  3099.             clear it to color index zero as well as reset the default
  3100.             palette.)
  3101.  
  3102.             SEE ALSO
  3103.  
  3104.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3105.             FILLCOLOR, FILLSCREEN, FILLVIEW
  3106.  
  3107.             EXAMPLE
  3108.  
  3109.             REM FILLS THE CURRENT VIDEO PAGE WITH A COLOR
  3110.             REM $INCLUDE: 'SVGABC.BI'
  3111.             DEFINT A-Z
  3112.  
  3113.             VMODE=VIDEOMODEGET
  3114.             IF WHICHVGA = 0 THEN STOP
  3115.             DUMMY=RES640
  3116.             DUMMY=PAGEACTIVE(0)
  3117.             FILLPAGE 10
  3118.             WHILE INKEY$ = ""
  3119.             WEND
  3120.             VIDEOMODESET VMODE
  3121.             END
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134.  
  3135.                                                                          49
  3136.  
  3137.  
  3138.  
  3139.  
  3140.  
  3141.           FILLSCREEN
  3142.  
  3143.             PROTOTYPE
  3144.  
  3145.             SUB FILLSCREEN (Color%)
  3146.  
  3147.             INPUT
  3148.  
  3149.             Color - index to color in current palette
  3150.  
  3151.             OUTPUT
  3152.  
  3153.             no value returned
  3154.  
  3155.             USAGE
  3156.  
  3157.             FILLSCREEN clears the entire screen with the specified color.
  3158.             All information on the screen is lost.  (Note, a faster method
  3159.             to clear the screen is to call any of the 'RES###' functions.
  3160.             These reset the graphics screen and automatically clear it to
  3161.             color index zero as well as reset the default palette.)
  3162.  
  3163.             SEE ALSO
  3164.  
  3165.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3166.             FILLCOLOR, FILLPAGE, FILLVIEW
  3167.  
  3168.             EXAMPLE
  3169.  
  3170.             REM FILLS THE SCREEN WITH A COLOR
  3171.             REM $INCLUDE: 'SVGABC.BI'
  3172.             DEFINT A-Z
  3173.  
  3174.             VMODE=VIDEOMODEGET
  3175.             IF WHICHVGA = 0 THEN STOP
  3176.             DUMMY=RES640
  3177.             FILLSCREEN 10
  3178.             WHILE INKEY$ = ""
  3179.             WEND
  3180.             VIDEOMODESET VMODE
  3181.             END
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.                                                                          50
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.           FILLVIEW
  3204.  
  3205.             PROTOTYPE
  3206.  
  3207.             SUB FILLVIEW (Color%)
  3208.  
  3209.             INPUT
  3210.  
  3211.             Color - index to color in current palette
  3212.  
  3213.             OUTPUT
  3214.  
  3215.             no value returned
  3216.  
  3217.             USAGE
  3218.  
  3219.             FILLVIEW fills the currently defined viewport with the
  3220.             specified color.  All information in the viewport is lost.
  3221.  
  3222.             SEE ALSO
  3223.  
  3224.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  3225.             FILLCOLOR, FILLPAGE, FILLSCREEN, SETVIEW
  3226.  
  3227.             EXAMPLE
  3228.  
  3229.             REM FILLS THE VIEWPORT WITH A COLOR
  3230.             REM $INCLUDE: 'SVGABC.BI'
  3231.             DEFINT A-Z
  3232.  
  3233.             VMODE=VIDEOMODEGET
  3234.             IF WHICHVGA = 0 THEN STOP
  3235.             DUMMY=RES640
  3236.             SETVIEW 100, 100, 539, 379
  3237.             FILLVIEW 10
  3238.             WHILE INKEY$ = ""
  3239.             WEND
  3240.             VIDEOMODESET VMODE
  3241.             END
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.  
  3251.  
  3252.  
  3253.  
  3254.  
  3255.  
  3256.  
  3257.  
  3258.  
  3259.                                                                          51
  3260.  
  3261.  
  3262.  
  3263.  
  3264.  
  3265.           FONTGETINFO
  3266.  
  3267.             PROTOTYPE
  3268.  
  3269.             SUB FONTGETINFO (Width%, Height%)
  3270.  
  3271.             INPUT
  3272.  
  3273.             no input parameters
  3274.  
  3275.             OUTPUT
  3276.  
  3277.             no value returned
  3278.             Width - width in pixels of current font
  3279.             Height - height in pixels of current font
  3280.  
  3281.             USAGE
  3282.  
  3283.             FONTGETINFO returns in Width and Height the dimensions of the
  3284.             currently loaded font.
  3285.  
  3286.             SEE ALSO
  3287.  
  3288.             FONTSET, FONTSYSTEM
  3289.  
  3290.             EXAMPLE
  3291.  
  3292.             REM GET INFO ON THE SYSTEM FONT
  3293.             REM $INCLUDE: 'SVGABC.BI'
  3294.             DEFINT A-Z
  3295.  
  3296.             VMODE=VIDEOMODEGET
  3297.             IF WHICHVGA = 0 THEN STOP
  3298.             DUMMY=RES640
  3299.             FONTGETINFO WDTH, HGTH
  3300.             A$ = "SYSTEM FONT WIDTH =" + STR$(WDTH)
  3301.             B$ = "SYSTEM FONT HEIGHT =" + STR$(HGTH)
  3302.             DRWSTRING 1, 7, 0, A$, 0, 0
  3303.             DRWSTRING 1, 7, 0, B$, 0, 20
  3304.             WHILE INKEY$ = ""
  3305.             WEND
  3306.             VIDEOMODESET VMODE
  3307.             END
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.                                                                          52
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.           FONTSET
  3328.  
  3329.             PROTOTYPE
  3330.  
  3331.             SUB FONTSET (Font$)
  3332.  
  3333.             INPUT
  3334.  
  3335.             Font$ - string * 4098 containing font data
  3336.  
  3337.             OUTPUT
  3338.  
  3339.             no value returned
  3340.  
  3341.             USAGE
  3342.  
  3343.             FONTSET loads the current font with the data in Font$.  The
  3344.             string must have at least 4098 members.  The first byte of
  3345.             Font$ holds the font width (1 to 8) and the second byte holds
  3346.             the font height (1 to 16).  The remaining 4096 bytes are the
  3347.             character raster data, 16 bytes per character.
  3348.  
  3349.             SEE ALSO
  3350.  
  3351.             FONTGETINFO, FONTSYSTEM
  3352.  
  3353.             EXAMPLE
  3354.  
  3355.             See FONTSYSTEM
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.  
  3375.  
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.                                                                          53
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.           FONTSYSTEM
  3390.  
  3391.             PROTOTYPE
  3392.  
  3393.             SUB FONTSYSTEM ()
  3394.  
  3395.             INPUT
  3396.  
  3397.             no input parameters
  3398.  
  3399.             OUTPUT
  3400.  
  3401.             no value returned
  3402.  
  3403.             USAGE
  3404.  
  3405.             FONTSYSTEM sets the current font to the standard system font.
  3406.             This font is automatically set when WHICHVGA is called.
  3407.  
  3408.             SEE ALSO
  3409.  
  3410.             WHICHVGA, FONTGETINFO, FONTSET
  3411.  
  3412.             EXAMPLE
  3413.  
  3414.             REM LOAD A FONT FROM DISK AND ENABLE IT
  3415.             REM THEN GO BACK TO THE SYSTEM FONT
  3416.             REM $INCLUDE: 'SVGABC.BI'
  3417.             DEFINT A-Z
  3418.  
  3419.             DIM NEWFONT AS STRING * 4098
  3420.  
  3421.             VMODE = VIDEOMODEGET
  3422.             IF WHICHVGA = 0 THEN STOP
  3423.             DUMMY=RES640
  3424.             OPEN "DRAGON.FNT" FOR BINARY AS #1
  3425.             GET #1, , NEWFONT
  3426.             CLOSE #1
  3427.             FONTSET NEWFONT
  3428.             DRWSTRING 1, 7, 0, "The Dragon Font!", 0, 0
  3429.             FONTSYSTEM
  3430.             DRWSTRING 1, 7, 0, "The System Font!", 0, 20
  3431.             WHILE INKEY$ = ""
  3432.             WEND
  3433.             VIDEOMODESET VMODE
  3434.             END
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.                                                                          54
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.           GETARCCOS
  3452.  
  3453.             PROTOTYPE
  3454.  
  3455.             FUNCTION GETARCCOS% (Value&)
  3456.  
  3457.             INPUT
  3458.  
  3459.             Value - number between -1 and +1 scaled up by 13 bits (8192)
  3460.  
  3461.             OUTPUT
  3462.  
  3463.             GETARCCOS returns the arc cosine of Value in degrees.
  3464.  
  3465.             USAGE
  3466.  
  3467.             GETARCCOS returns the arc cosine in degrees for the given
  3468.             value.  The return will be between 0 and 180 degrees.  Value
  3469.             should be between -8192 and +8192 representing the range -1 to
  3470.             +1.  Input values outside this range are invalid and GETARCCOS
  3471.             will return -32768. Floating point values are ignored.  This
  3472.             function uses an integer lookup table stored within the
  3473.             library in order to produce the fastest possible results.  No
  3474.             floating point arithmetic is used.  The scale factor of 13
  3475.             bits (8192) was chosen because this is the number of bits at
  3476.             which every change of one degree gives a change in the value
  3477.             of the sine (or cosine) function.
  3478.  
  3479.             SEE ALSO
  3480.  
  3481.             GETARCSIN, GETARCTAN, GETCOS, GETSIN, GETTAN
  3482.  
  3483.             EXAMPLE
  3484.  
  3485.             REM SHOW GETARCCOS
  3486.             REM $INCLUDE: 'SVGABC.BI'
  3487.             DEFINT A-Z
  3488.  
  3489.             VMODE = VIDEOMODEGET
  3490.             IF WHICHVGA = 0 THEN STOP
  3491.             DUMMY=RES640
  3492.             DRWBOX 1, 10, 0, 0, 639, 479
  3493.             DRWLINE 1, 10, 0, 240, 639, 240
  3494.             DRWLINE 1, 10, 320, 0, 320, 479
  3495.             DEG2RAD! = 4 * ATN(1) / 180
  3496.             FOR I = -8192 TO 8192 STEP 16
  3497.                Y1& = GETARCCOS(I)
  3498.                DRWPOINT 1, 12, 320 + Y1& * 3, 240 - I / 34
  3499.             NEXT I
  3500.             WHILE INKEY$ = ""
  3501.             WEND
  3502.             VIDEOMODESET VMODE
  3503.             END
  3504.  
  3505.  
  3506.  
  3507.                                                                          55
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.           GETARCSIN
  3514.  
  3515.             PROTOTYPE
  3516.  
  3517.             FUNCTION GETARCSIN (Value&)
  3518.  
  3519.             INPUT
  3520.  
  3521.             Value - number between -1 and +1 scaled up by 13 bits (8192)
  3522.  
  3523.             OUTPUT
  3524.  
  3525.             GETARCSIN returns the arc sine of Value in degrees.
  3526.  
  3527.             USAGE
  3528.  
  3529.             GETARCSIN returns the arc sine in degrees for the given value.
  3530.             The return will be between -90 and +90 degrees.  Value should
  3531.             be between -8192 and +8192 representing the range -1 to +1.
  3532.             Input values outside this range are invalid and GETARCSIN will
  3533.             return -32768. Floating point values are ignored.  This
  3534.             function uses an integer lookup table stored within the
  3535.             library in order to produce the fastest possible results.  No
  3536.             floating point arithmetic is used.  The scale factor of 13
  3537.             bits (8192) was chosen because this is the number of bits at
  3538.             which every change of one degree gives a change in the value
  3539.             of the sine (or cosine) function.
  3540.  
  3541.             SEE ALSO
  3542.  
  3543.             GETARCCOS, GETARCTAN, GETCOS, GETSIN, GETTAN
  3544.  
  3545.             EXAMPLE
  3546.  
  3547.             REM SHOW GETARCSIN
  3548.             REM $INCLUDE: 'SVGABC.BI'
  3549.             DEFINT A-Z
  3550.  
  3551.             VMODE = VIDEOMODEGET
  3552.             IF WHICHVGA = 0 THEN STOP
  3553.             DUMMY=RES640
  3554.             DRWBOX 1, 10, 0, 0, 639, 479
  3555.             DRWLINE 1, 10, 0, 240, 639, 240
  3556.             DRWLINE 1, 10, 320, 0, 320, 479
  3557.             DEG2RAD! = 4 * ATN(1) / 180
  3558.             FOR I = -8192 TO 8192 STEP 16
  3559.                Y1& = GETARCSIN(I)
  3560.                DRWPOINT 1, 12, 320 + Y1& * 3, 240 - I / 34
  3561.             NEXT I
  3562.             WHILE INKEY$ = ""
  3563.             WEND
  3564.             VIDEOMODESET VMODE
  3565.             END
  3566.  
  3567.  
  3568.  
  3569.                                                                          56
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.           GETARCTAN
  3576.  
  3577.             PROTOTYPE
  3578.  
  3579.             FUNCTION GETARCTAN (Value&)
  3580.  
  3581.             INPUT
  3582.  
  3583.             Value - long integer representing a decimal scaled up by 13
  3584.             bits (8192)
  3585.  
  3586.             OUTPUT
  3587.  
  3588.             GETARCTAN returns the arc tangent of Value in degrees.
  3589.  
  3590.             USAGE
  3591.  
  3592.             GETARCTAN returns the arc cosine in degrees for the given
  3593.             value.  The return will be between -89 and +89 degrees.  Value
  3594.             can be any long integer.  It is interpreted as a decimal
  3595.             scaled up by 8192 (13 bits). Floating point values are
  3596.             ignored.  This function uses an integer lookup table stored
  3597.             within the library in order to produce the fastest possible
  3598.             results.  No floating point arithmetic is used.  The scale
  3599.             factor of 13 bits (8192) was chosen because this is the number
  3600.             of bits at which every change of one degree gives a change in
  3601.             the value of the sine (or cosine) function.
  3602.  
  3603.             SEE ALSO
  3604.  
  3605.             GETARCCOS, GETARCSIN, GETCOS, GETSIN, GETTAN
  3606.  
  3607.             EXAMPLE
  3608.  
  3609.             REM SHOW GETARCTAN
  3610.             REM $INCLUDE: 'SVGABC.BI'
  3611.             DEFINT A-Z
  3612.  
  3613.             VMODE = VIDEOMODEGET
  3614.             IF WHICHVGA = 0 THEN STOP
  3615.             DUMMY=RES640
  3616.             DRWBOX 1, 10, 0, 0, 639, 479
  3617.             DRWLINE 1, 10, 0, 240, 639, 240
  3618.             DRWLINE 1, 10, 320, 0, 320, 479
  3619.             DEG2RAD! = 4 * ATN(1) / 180
  3620.             FOR I = -8192 TO 8192 STEP 16
  3621.                Y1& = GETARCTAN(I)
  3622.                Y2& = ATN(I / 8192) / DEG2RAD!
  3623.                DRWPOINT 1, 12, 320 + Y1& * 6, 240 - I / 34
  3624.                DRWPOINT 1, 15, 320 + Y2& * 6, 240 - I / 34
  3625.             NEXT I
  3626.             WHILE INKEY$ = ""
  3627.             WEND
  3628.             VIDEOMODESET VMODE
  3629.  
  3630.  
  3631.                                                                          57
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.             END
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.                                                                          58
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.           GETCOS
  3700.  
  3701.             PROTOTYPE
  3702.  
  3703.             FUNCTION GETCOS& (Angle&)
  3704.  
  3705.             INPUT
  3706.  
  3707.             Angle - angle in degrees
  3708.  
  3709.             OUTPUT
  3710.  
  3711.             GETCOS returns the cosine of Angle scaled up by 13 bits
  3712.             (8192).
  3713.  
  3714.             USAGE
  3715.  
  3716.             GETCOS returns the cosine of the specified angle.  Angle can
  3717.             be any long value; floating point values are ignored.  The
  3718.             return value has been multiplied by 8192.  This function uses
  3719.             an integer lookup table stored within the library in order to
  3720.             produce the fastest possible results.  No floating point
  3721.             arithmetic is used.  The scale factor of 13 bits (8192) was
  3722.             chosen because this is the number of bits at which every
  3723.             change of one degree gives a change in the value of the sine
  3724.             (or cosine) function.
  3725.  
  3726.             SEE ALSO
  3727.  
  3728.             GETARCCOS, GETARCSIN, GETARCTAN, GETSIN, GETTAN
  3729.  
  3730.             EXAMPLE
  3731.  
  3732.             REM SHOW GETCOS
  3733.             REM $INCLUDE: 'SVGABC.BI'
  3734.             DEFINT A-Z
  3735.  
  3736.             VMODE = VIDEOMODEGET
  3737.             IF WHICHVGA = 0 THEN STOP
  3738.             DUMMY=RES640
  3739.             DRWBOX 1, 10, 0, 0, 639, 479
  3740.             DRWLINE 1, 10, 0, 240, 639, 240
  3741.             DRWLINE 1, 10, 320, 0, 320, 479
  3742.             DEG2RAD! = 4 * ATN(1) / 180
  3743.             FOR I = -360 TO 360
  3744.                Y1& = GETCOS(I)
  3745.                Y1& = Y1& * 240 / 8192
  3746.                Y2& = 240 * COS(I * DEG2RAD!)
  3747.                DRWPOINT 1, 15, 320 + I, 240 - Y1&
  3748.                DRWPOINT 1, 12, 320 + I, 240 - Y2&
  3749.             NEXT I
  3750.             WHILE INKEY$ = ""
  3751.             WEND
  3752.             VIDEOMODESET VMODE
  3753.  
  3754.  
  3755.                                                                          59
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.             END
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.  
  3778.  
  3779.  
  3780.  
  3781.  
  3782.  
  3783.  
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.  
  3791.  
  3792.  
  3793.  
  3794.  
  3795.  
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.                                                                          60
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.           GETLASTSTRING
  3824.  
  3825.             PROTOTYPE
  3826.  
  3827.             SUB GETLASTSTRING (GfxBlk%)
  3828.  
  3829.             INPUT
  3830.  
  3831.             no input parameters
  3832.  
  3833.             OUTPUT
  3834.  
  3835.             no value returned
  3836.             GfxBlk - integer destination array holding bitmap of text
  3837.             block
  3838.  
  3839.             USAGE
  3840.  
  3841.             GETLASTSTRING returns the text drawn on the screen by the last
  3842.             called DRWSTRING function.  The text is returned in GfxBlk
  3843.             which may be used with BLKPUT or the sprite functions.  The
  3844.             text in GfxBlk is oriented in the same manner as the last
  3845.             called DRWSTRING function.  The intended use is to call the
  3846.             DRWSTRING function using mode 0 which does not actually draw
  3847.             text on the screen.  GETLASTSTRING should be called
  3848.             immediately after the DRWSTRING function to prevent possible
  3849.             loss of data caused by other functions.
  3850.  
  3851.             GfxBlk must be dimensioned as a short integer array with a
  3852.             size in integers equal to
  3853.  
  3854.                     [(fontwidth*stringlength)*(fontheight)] / 2+3.
  3855.  
  3856.             The font's dimensions can be obtained by calling FONTGETINFO
  3857.             and the string's length can be obtained using Basic's LEN
  3858.             function.  Note, however, that GfxBlk can be quite large.  If
  3859.             the size of GfxBlk is insufficient, GETLASTSTRING will
  3860.             overwrite any data in memory contained beyond GfxBlk and may
  3861.             possibly cause the system to crash.
  3862.  
  3863.             Arrays should be passed by giving the element within the array
  3864.             from where the action should take place.  This allows the
  3865.             programmer to store more than one item within the same array
  3866.             or act on only a portion of the array.
  3867.  
  3868.             SEE ALSO
  3869.  
  3870.             BLKPUT, DRWSTRING, DRWSTRINGDN, DRWSTRINGLT, DRWSTRINGRT,
  3871.             FONTGETINFO
  3872.  
  3873.             EXAMPLE
  3874.  
  3875.             REM USES GETLASTSTRING TO DRAW SOME TEXT AT THE CENTER OF THE
  3876.             SCREEN
  3877.  
  3878.  
  3879.                                                                          61
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.             REM $INCLUDE: 'SVGABC.BI'
  3886.             DEFINT A-Z
  3887.  
  3888.             VMODE=VIDEOMODEGET
  3889.             IF WHICHVGA = 0 THEN STOP
  3890.             DUMMY=RES640
  3891.             A$ = "HELLO WORLD"
  3892.             DRWSTRING 0, 10, 0, A$, 0, 0
  3893.             FONTGETINFO W, H
  3894.             L = LEN(A$)
  3895.             BLKSIZE = ( (W*L)*H )\2 + 3
  3896.             DIM BLK(0 TO BLKSIZE)
  3897.             GETLASTSTRING BLK(0)
  3898.             BLKPUT 1, 320, 240, BLK(0)
  3899.             WHILE INKEY$ = ""
  3900.             WEND
  3901.             VIDEOMODESET VMODE
  3902.             END
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.                                                                          62
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.           GETMAXX
  3948.  
  3949.             PROTOTYPE
  3950.  
  3951.             FUNCTION GETMAXX% ()
  3952.  
  3953.             INPUT
  3954.  
  3955.             no input parameters
  3956.  
  3957.             OUTPUT
  3958.  
  3959.             GETMAXX returns the current horizontal resolution of the
  3960.             screen.
  3961.  
  3962.             USAGE
  3963.  
  3964.             GETMAXX returns the horizontal resolution of the screen in the
  3965.             current mode.  This function should only be called if one of
  3966.             the RES### functions has been previously called.  Otherwise,
  3967.             the value returned is meaningless.
  3968.  
  3969.             SEE ALSO
  3970.  
  3971.             GETMAXY
  3972.  
  3973.             EXAMPLE
  3974.  
  3975.             REM SHOW GETMAXX
  3976.             REM $INCLUDE: 'SVGABC.BI'
  3977.             DEFINT A-Z
  3978.  
  3979.             VMODE = VIDEOMODEGET
  3980.             IF WHICHVGA = 0 THEN STOP
  3981.             DUMMY=RES640
  3982.             X$ = "MAX X SCREEN VALUE IS:" + STR$(GETMAXX)
  3983.             DRWSTRING 1, 7, 0, X$, 0, 0
  3984.             SETVIEW 0, 0, 400, 479
  3985.             X$ = "MAX X SCREEN VALUE IS STILL:" + STR$(GETMAXX)
  3986.             DRWSTRING 1, 7, 0, X$, 0, 20
  3987.             WHILE INKEY$ = ""
  3988.             WEND
  3989.             VIDEOMODESET VMODE
  3990.             END
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.  
  4001.  
  4002.  
  4003.                                                                          63
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.           GETMAXY
  4010.  
  4011.             PROTOTYPE
  4012.  
  4013.             FUNCTION GETMAXY% ()
  4014.  
  4015.             INPUT
  4016.  
  4017.             no input parameters
  4018.  
  4019.             OUTPUT
  4020.  
  4021.             GETMAXY returns the current vertical resolution of the screen.
  4022.  
  4023.             USAGE
  4024.  
  4025.             GETMAXY returns the vertical resolution of the screen in the
  4026.             current mode.  This function should only be called if one of
  4027.             the RES### functions has been previously called.  Otherwise,
  4028.             the value returned is meaningless.
  4029.  
  4030.             SEE ALSO
  4031.  
  4032.             GETMAXX
  4033.  
  4034.             EXAMPLE
  4035.  
  4036.             REM SHOW GETMAXY
  4037.             REM $INCLUDE: 'SVGABC.BI'
  4038.             DEFINT A-Z
  4039.  
  4040.             VMODE = VIDEOMODEGET
  4041.             IF WHICHVGA = 0 THEN STOP
  4042.             DUMMY=RES640
  4043.             Y$ = "MAX Y SCREEN VALUE IS:" + STR$(GETMAXY)
  4044.             DRWSTRING 1, 7, 0, Y$, 0, 0
  4045.             SETVIEW 0, 0, 639, 200
  4046.             Y$ = "MAX Y SCREEN VALUE IS STILL:" + STR$(GETMAXY)
  4047.             DRWSTRING 1, 7, 0, Y$, 0, 20
  4048.             WHILE INKEY$ = ""
  4049.             WEND
  4050.             VIDEOMODESET VMODE
  4051.             END
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.                                                                          64
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.           GETPOINT
  4072.  
  4073.             PROTOTYPE
  4074.  
  4075.             FUNCTION GETPOINT% (X%, Y%)
  4076.  
  4077.             INPUT
  4078.  
  4079.             X, Y - location of pixel to read
  4080.  
  4081.             OUTPUT
  4082.  
  4083.             GETPOINT returns the color index of pixel at X, Y.
  4084.  
  4085.             USAGE
  4086.  
  4087.             GETPOINT returns the value of the pixel at location X, Y.
  4088.             This value is a color index into the current palette.
  4089.  
  4090.             SEE ALSO
  4091.  
  4092.             DRWPOINT
  4093.  
  4094.             EXAMPLE
  4095.  
  4096.             REM DRAW A POINT AND CHECK TO MAKE SURE IT IS THERE
  4097.             REM $INCLUDE: 'SVGABC.BI'
  4098.  
  4099.             DEFINT A-Z
  4100.             IF WHICHVGA = 0 THEN STOP
  4101.             IF WHICHMEM < 512 THEN STOP
  4102.             VMODE = VIDEOMODEGET
  4103.             DUMMY=RES640
  4104.             DRWPOINT 1, 10, 320, 240
  4105.             POINTVALUE = GETPOINT(320, 240)
  4106.             A$ = "THE POINT VALUE IS:" + STR$(POINTVALUE)
  4107.             DRWSTRING 1, 7, 0, A$, 0, 0
  4108.             WHILE INKEY$ = ""
  4109.             WEND
  4110.             VIDEOMODESET VMODE
  4111.             END
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.                                                                          65
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.           GETSIN
  4134.  
  4135.             PROTOTYPE
  4136.  
  4137.             FUNCTION GETSIN& (Angle&)
  4138.  
  4139.             INPUT
  4140.  
  4141.             Angle - angle in degrees
  4142.  
  4143.             OUTPUT
  4144.  
  4145.             GETSIN returns the sine of Angle scaled up by 13 bits (8192).
  4146.  
  4147.             USAGE
  4148.  
  4149.             GETSIN returns the sine of the specified angle.  Angle can be
  4150.             any long value; floating point values are ignored.  The return
  4151.             value has been multiplied by 8192.  This function uses an
  4152.             integer lookup table stored within the library in order to
  4153.             produce the fastest possible results.  No floating point
  4154.             arithmetic is used.  The scale factor of 13 bits (8192) was
  4155.             chosen because this is the number of bits at which every
  4156.             change of one degree gives a change in the value of the sine
  4157.             (or cosine) function.
  4158.  
  4159.             SEE ALSO
  4160.  
  4161.             GETARCCOS, GETARCSIN, GETARCTAN, GETCOS, GETTAN
  4162.  
  4163.             EXAMPLE
  4164.  
  4165.             REM SHOW GETSIN
  4166.             REM $INCLUDE: 'SVGABC.BI'
  4167.             DEFINT A-Z
  4168.  
  4169.             VMODE = VIDEOMODEGET
  4170.             IF WHICHVGA = 0 THEN STOP
  4171.             DUMMY=RES640
  4172.             DRWBOX 1, 10, 0, 0, 639, 479
  4173.             DRWLINE 1, 10, 0, 240, 639, 240
  4174.             DRWLINE 1, 10, 320, 0, 320, 479
  4175.             DEG2RAD! = 4 * ATN(1) / 180
  4176.             FOR I = -360 TO 360
  4177.                Y1& = GETSIN(I)
  4178.                Y1& = Y1& * 240 / 8192
  4179.                Y2& = 240 * SIN(I * DEG2RAD!)
  4180.                DRWPOINT 1, 15, 320 + I, 240 - Y1&
  4181.                DRWPOINT 1, 12, 320 + I, 240 - Y2&
  4182.             NEXT I
  4183.             WHILE INKEY$ = ""
  4184.             WEND
  4185.             VIDEOMODESET VMODE
  4186.             END
  4187.  
  4188.  
  4189.                                                                          66
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.           GETTAN
  4196.  
  4197.             PROTOTYPE
  4198.  
  4199.             FUNCTION GETTAN& (Angle%)
  4200.  
  4201.             INPUT
  4202.  
  4203.             Angle - angle in degrees
  4204.  
  4205.             OUTPUT
  4206.  
  4207.             GETTAN returns the tangent of Angle scaled up by 13 bits
  4208.             (8192).
  4209.  
  4210.             USAGE
  4211.  
  4212.             GETTAN returns the tangent of the specified angle.  Angle can
  4213.             be any long value except +(90+n*180), where n is an integer.
  4214.             Floating point values are ignored.  The return value has been
  4215.             multiplied by 8192.  If an invalid angle is given, the GETTAN
  4216.             will return &H80000000 (-2147483648).  This function uses an
  4217.             integer lookup table stored within the library in order to
  4218.             produce the fastest possible results.  No floating point
  4219.             arithmetic is used.  The scale factor of 13 bits (8192) was
  4220.             chosen because this is the number of bits at which every
  4221.             change of one degree gives a change in the value of the sine
  4222.             (or cosine) function.
  4223.  
  4224.             SEE ALSO
  4225.  
  4226.             GETARCCOS, GETARCSIN, GETARCTAN, GETCOS, GETSIN
  4227.  
  4228.             EXAMPLE
  4229.  
  4230.             REM SHOW GETTAN
  4231.             REM $INCLUDE: 'SVGABC.BI'
  4232.             DEFINT A-Z
  4233.  
  4234.             VMODE = VIDEOMODEGET
  4235.             IF WHICHVGA = 0 THEN STOP
  4236.             DUMMY=RES640
  4237.             DRWBOX 1, 10, 0, 0, 639, 479
  4238.             DRWLINE 1, 10, 0, 240, 639, 240
  4239.             DRWLINE 1, 10, 320, 0, 320, 479
  4240.             DEG2RAD! = 4 * ATN(1) / 180
  4241.             FOR I = -360 TO 360
  4242.                IF ((I - 90) / 180) <> INT((I - 90) / 180) THEN
  4243.                  Y1& = GETTAN(I)
  4244.                  Y1& = Y1& * 240 / 8192
  4245.                  Y2& = 240 * TAN(I * DEG2RAD!)
  4246.                  DRWPOINT 1, 15, 320 + I, 240 - Y1&
  4247.                  DRWPOINT 1, 12, 320 + I, 240 - Y2&
  4248.                END IF
  4249.  
  4250.  
  4251.                                                                          67
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.             NEXT I
  4258.             WHILE INKEY$ = ""
  4259.             WEND
  4260.             VIDEOMODESET VMODE
  4261.             END
  4262.  
  4263.  
  4264.  
  4265.  
  4266.  
  4267.  
  4268.  
  4269.  
  4270.  
  4271.  
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.                                                                          68
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.           GIFGETINFO
  4320.  
  4321.             PROTOTYPE
  4322.  
  4323.             FUNCTION GIFGETINFO% (Filename$, Width%, Height%, NumColors%,
  4324.             Palette$)
  4325.  
  4326.             INPUT
  4327.  
  4328.             Filename$ - the filename of the GIF image to read
  4329.  
  4330.             OUTPUT
  4331.  
  4332.             GIFGETINFO returns the status of the function (1 = success).
  4333.             Width - the width in pixels of the image
  4334.             Height - the height in pixels of the image
  4335.             NumColors - the number of colors in the image palette
  4336.             Palette$ - string*768 containing the image palette
  4337.  
  4338.             USAGE
  4339.  
  4340.             GIFGETINFO reads Filename$ and returns the characteristics of
  4341.             the image.  The dimensions of the image are returned in Width,
  4342.             Height.  The number of colors in the image's palette is
  4343.             returned in NumColors and the palette is returned in Palette$.
  4344.             Although the image's palette may contain less than 256 colors,
  4345.             Palette$ must be 768 characters in length.  The image's
  4346.             palette will begin with the first character of Palette$.
  4347.  
  4348.             For ease of programming the GIF decoder requires that the
  4349.             image be non-interlaced, use only a global color map and be
  4350.             compressed according to GIF87a specifications.
  4351.  
  4352.             If GIFGETINFO determines that Filename$ is a satisfactory
  4353.             file, the function will return a one.  Otherwise, the function
  4354.             will return one of several error codes concerning Filename$ as
  4355.             listed below:
  4356.  
  4357.             0 =  does not exist or there is some disk I/O problem
  4358.             -1 = does not have the GIF87a signature
  4359.             -2 = image is interlaced
  4360.             -3 = does not use a global color map
  4361.             -4 = has some general error
  4362.  
  4363.             SEE ALSO
  4364.  
  4365.             GIFMAKE, GIFPUT
  4366.  
  4367.             EXAMPLE
  4368.  
  4369.             REM GET THE INFORMATION OF THE GIF FILE 'UTTOWER.GIF'
  4370.             REM $INCLUDE: 'SVGABC.BI'
  4371.             DEFINT A-Z
  4372.             DIM GIFPAL AS STRING * 768
  4373.  
  4374.  
  4375.                                                                          69
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.             CLS
  4383.             GIFFILENAME$="UTTOWER.GIF"
  4384.             PRINT
  4385.             OK = GIFGETINFO(GIFFILENAME$, XSIZE, YSIZE, NUMCOL, GIFPAL)
  4386.             IF OK = 1 THEN
  4387.                A$ = "'" + GIFFILENAME$ + "' is identified as a 'Non-
  4388.             Interlaced' type GIF"
  4389.                A$ = A$ + "'GIF87a' GIF."
  4390.                PRINT A$
  4391.                A$ = "Dimensions are:" + STR$(XSIZE) + " pixels wide and" +
  4392.             STR$(YSIZE)
  4393.                A$ = A$ + " pixels high"
  4394.                PRINT A$
  4395.                A$ = "Number of colors:" + STR$(NUMCOL)
  4396.                PRINT A$
  4397.             END IF
  4398.             WHILE INKEY$ = ""
  4399.             WEND
  4400.             END
  4401.  
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408.  
  4409.  
  4410.  
  4411.  
  4412.  
  4413.  
  4414.  
  4415.  
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.                                                                          70
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.           GIFMAKE
  4444.  
  4445.             PROTOTYPE
  4446.  
  4447.             FUNCTION GIFMAKE% (X1%, Y1%, X2%, Y2%, Filename$)
  4448.  
  4449.             INPUT
  4450.  
  4451.             X1, Y1 - the location of the top, left corner of the image
  4452.             X2, Y2 - the bottom, right corner of the image
  4453.             Filename$ - filename to store the GIF image
  4454.  
  4455.             OUTPUT
  4456.  
  4457.             GIFMAKE returns a 1 if successful, 0 if unsuccessful.
  4458.  
  4459.             USAGE
  4460.  
  4461.             GIFMAKE takes the bitmap enclosed in the box defined by (X1,
  4462.             Y1) - (X2, Y2) and writes a GIF with the filename specified by
  4463.             Filename$.  The resulting file uses the GIF87a compression
  4464.             specifications.  X1, Y1, X2 and Y2 must be valid coordinates
  4465.             on the currently active page.  Filename$ may specify a full
  4466.             path and drive letter, if necessary.
  4467.  
  4468.             SEE ALSO
  4469.  
  4470.             GIFGETINFO, GIFPUT
  4471.  
  4472.             EXAMPLE
  4473.  
  4474.             REM MAKE A 256 COLOR GIF FILE
  4475.             REM $INCLUDE: 'SVGABC.BI'
  4476.             DEFINT A-Z
  4477.             DIM DT(0 TO 10000) AS INTEGER
  4478.             IF WHICHCPU < 386 THEN END
  4479.             IF WHICHVGA = 0 THEN END
  4480.             VMODE = VIDEOMODEGET
  4481.             DUMMY = RES640
  4482.             FILLSCREEN 10
  4483.             FOR A = 0 TO 200
  4484.                X1 = RND * GETMAXX
  4485.                Y1 = RND * GETMAXY
  4486.                X2 = RND * GETMAXX
  4487.                Y2 = RND * GETMAXY
  4488.                C = RND * 255
  4489.                DRWLINE 1, C, X1, Y1, X2, Y2
  4490.             NEXT A
  4491.             DRWBOX 1, 15, 0, 0, GETMAXX, GETMAXY
  4492.             A$ = "This GIF file was created using Zephyr Software's
  4493.             'GIFMAKE' function!"
  4494.             DRWSTRING 1, 15, 0, A$, 2, 2
  4495.             ER = GIFMAKE(0, 0, GETMAXX, GETMAXY, "TEST.GIF")
  4496.             VIDEOMODESET VMODE
  4497.  
  4498.  
  4499.                                                                          71
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.             IF ER <> 1 THEN
  4506.                PRINT "GIF MAKE ERROR!"
  4507.             END IF
  4508.             END
  4509.  
  4510.  
  4511.  
  4512.  
  4513.  
  4514.  
  4515.  
  4516.  
  4517.  
  4518.  
  4519.  
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.                                                                          72
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.           GIFPUT
  4568.  
  4569.             PROTOTYPE
  4570.  
  4571.             FUNCTION GIFPUT (Mode%, X%, Y%, Filename$)
  4572.  
  4573.             INPUT
  4574.  
  4575.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  4576.             X, Y - the location of the top, left corner of the GIF image
  4577.             Filename$ - filename of the GIF image to read
  4578.  
  4579.             OUTPUT
  4580.  
  4581.             GIFPUT returns the status of the function (1 = success).
  4582.  
  4583.             USAGE
  4584.  
  4585.             GIFPUT reads the GIF image from Filename$ and places it on the
  4586.             screen with the top, left corner at X, Y.  The image is
  4587.             automatically clipped to the currently defined viewport.  The
  4588.             image's palette should be previously obtained by using
  4589.             GIFGETINFO.
  4590.  
  4591.             For ease of programming the GIF decoder requires that the
  4592.             image be non-interlaced, use only a global color map and be
  4593.             compressed according to GIF87a specifications.
  4594.  
  4595.             If GIFPUT encounters no problems, the function will return a
  4596.             one.  Otherwise, the function will return one of several error
  4597.             codes concerning Filename$ as listed below:
  4598.  
  4599.             0 =  does not exist or there is some disk I/O problem
  4600.             -1 = does not have the GIF87a signature
  4601.             -2 = image is interlaced
  4602.             -3 = does not use a global color map
  4603.             -4 = has some general error
  4604.  
  4605.             SEE ALSO
  4606.  
  4607.             GIFGETINFO, GIFMAKE, SETVIEW
  4608.  
  4609.             EXAMPLE
  4610.  
  4611.             REM DISPLAY THE GIF FILE 'UTTOWER.GIF'
  4612.             REM $INCLUDE: 'SVGABC.BI'
  4613.             DEFINT A-Z
  4614.             DIM GIFPAL AS STRING * 768
  4615.  
  4616.             IF WHICHVGA = 0 THEN STOP
  4617.             IF WHICHMEM < 512 THEN STOP
  4618.             GIFFILENAME$="UTTOWER.GIF"
  4619.             VMODE = VIDEOMODEGET
  4620.             DUMMY=RES640
  4621.  
  4622.  
  4623.                                                                          73
  4624.  
  4625.  
  4626.  
  4627.  
  4628.  
  4629.             OK = GIFGETINFO(GIFFILENAME$, XSIZE, YSIZE, NUMCOL, GIFPAL)
  4630.             IF OK = 1 THEN
  4631.                FIXIT = 0
  4632.                FOR A = 1 TO NUMCOL * 3 STEP 3
  4633.                  R = ASC(MID$(GIFPAL, A, 1))
  4634.                  G = ASC(MID$(GIFPAL, A + 1, 1))
  4635.                  B = ASC(MID$(GIFPAL, A + 2, 1))
  4636.                  IF R > 63 THEN
  4637.                     FIXIT = 1
  4638.                     EXIT FOR
  4639.                  END IF
  4640.                  IF G > 63 THEN
  4641.                     FIXIT = 1
  4642.                     EXIT FOR
  4643.                  END IF
  4644.                  IF B > 63 THEN
  4645.                     FIXIT = 1
  4646.                     EXIT FOR
  4647.                  END IF
  4648.                NEXT A
  4649.                IF FIXIT = 1 THEN
  4650.                  FOR A = 1 TO NUMCOL * 3
  4651.                     C = ASC(MID$(GIFPAL, A, 1))
  4652.                     MID$(GIFPAL, A, 1) = CHR$(C \ 4)
  4653.                NEXT A
  4654.                END IF
  4655.                PALSET GIFPAL, 0, 255
  4656.                OK = GIFPUT(1, 0, 0, GIFFILENAME$)
  4657.                IF OK <> 1 THEN
  4658.                  SOUND 100, 5
  4659.                END IF
  4660.             END IF
  4661.             WHILE INKEY$ = ""
  4662.             WEND
  4663.             VIDEOMODESET VMODE
  4664.             END
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.                                                                          74
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.           JOYSTICKINFO
  4692.  
  4693.             PROTOTYPE
  4694.  
  4695.             SUB JOYSTICKINFO (JAX%, JAY%, JAButs%, JBX%, JBY%, JBButs%)
  4696.  
  4697.             INPUT
  4698.  
  4699.             no input parameters
  4700.  
  4701.             OUTPUT
  4702.  
  4703.             no value returned
  4704.             JAX, JAY - horizontal and vertical values of joystick A
  4705.             JAButs - button status of joystick A
  4706.             JBX, JBY - horizontal and vertical values of joystick B
  4707.             JBButs - button status of joystick B
  4708.  
  4709.             USAGE
  4710.  
  4711.             JOYSTICKINFO returns the current status of the two joysticks'
  4712.             position and buttons.  The position is returned in JAX, JAY
  4713.             for joystick A and JBX, JBY for joystick B.  The buttons'
  4714.             status is held in JAButs and JBButs.  For each joystick,
  4715.             button A - usually the fire button - is held in bit zero and
  4716.             button B is in bit one.  Button status is most easily checked
  4717.             with a bitwise AND of JAButs (or JBButs) and the desired bit.
  4718.  
  4719.             Not all joysticks are constructed the same.  In addition,
  4720.             joysticks are not linear devices.  The value of its center
  4721.             will not necessarily be the mean of its extreme values.
  4722.             Therefore, it is recommended that any program using the
  4723.             joystick for more than just directional control complete a
  4724.             calibration of the joystick prior to usage.  For an example of
  4725.             joystick calibration, see the SVGADEMO.EXE source code.
  4726.  
  4727.             SEE ALSO
  4728.  
  4729.             WHICHJOYSTICK
  4730.  
  4731.             EXAMPLE
  4732.  
  4733.             REM DISPLAY THE STATUS OF THE JOYSTICK PORT
  4734.             REM $INCLUDE: 'SVGABC.BI'
  4735.             DEFINT A-Z
  4736.  
  4737.             CLS
  4738.             WHILE INKEY$ = ""
  4739.                JOYSTICKINFO JAX, JAY, JAButs, JBX, JBY, JBButs
  4740.                LOCATE 1, 1
  4741.                PRINT STRING$(40, 32)
  4742.                LOCATE 1, 1
  4743.                PRINT JAX; JAY; JAButs, JBX; JBY; JBButs;
  4744.                SDELAY 4
  4745.  
  4746.  
  4747.                                                                          75
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.             WEND
  4754.             END
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767.  
  4768.  
  4769.  
  4770.  
  4771.  
  4772.  
  4773.  
  4774.  
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.                                                                          76
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.           MOUSEBUTPRESS
  4816.  
  4817.             PROTOTYPE
  4818.  
  4819.             SUB MOUSEBUTPRESS (ReqButton%, X%, Y%, Num%, MouseButs%)
  4820.  
  4821.             INPUT
  4822.  
  4823.             ReqButton - button for which information is requested
  4824.  
  4825.             OUTPUT
  4826.  
  4827.             no value returned
  4828.             X, Y - current location of mouse cursor
  4829.             Num - number of times button has been pressed since last
  4830.             request
  4831.             MouseButs - current status of the mouse buttons
  4832.  
  4833.             USAGE
  4834.  
  4835.             MOUSEBUTPRESS returns in Num the number of times a mouse
  4836.             button has been pressed since the last call to MOUSEBUTPRESS.
  4837.             In addition the current status of the mouse cursor and buttons
  4838.             is returned.  The position is returned in X, Y.  The buttons'
  4839.             status is held in MouseButs.  The left button is held in bit
  4840.             zero, right button in bit one and center button - for three
  4841.             button mice - in bit two.  Button status is most easily
  4842.             checked with a bitwise AND of MouseButs and the desired bit.
  4843.             The button for which a history is desired is identified by the
  4844.             bits in ReqButton.  However, only one bit may be set.
  4845.             Therefore, only the values of 1, 2 and 4 are permitted.  If
  4846.             more than one bit in ReqButton is set, the function will exit
  4847.             and no information will be returned.
  4848.  
  4849.             SEE ALSO
  4850.  
  4851.             MOUSEBUTRELEASE, MOUSESTATUS
  4852.  
  4853.             EXAMPLE
  4854.  
  4855.             REM ENABLE, SHOW, MOUSE / DISPLAY LEFT BUTTON PRESS HISTORY
  4856.             REM FOR THE LAST 2 SECONDS
  4857.             REM $INCLUDE: 'SVGABC.BI'
  4858.             DEFINT A-Z
  4859.  
  4860.             VMODE = VIDEOMODEGET
  4861.             IF WHICHVGA = 0 THEN STOP
  4862.             IF WHICHMOUSE = 0 THEN STOP
  4863.             DUMMY=RES640
  4864.             MOUSEENTER
  4865.             MOUSESHOW
  4866.             WHILE INKEY$ = ""
  4867.                MOUSEBUTPRESS 1, X, Y, N, MBUTS
  4868.                D$ = "MX=" + STR$(X)
  4869.  
  4870.  
  4871.                                                                          77
  4872.  
  4873.  
  4874.  
  4875.  
  4876.  
  4877.                L = LEN(D$)
  4878.                IF L < 10 THEN
  4879.                  D$ = D$ + STRING$(8 - L, 32)
  4880.                END IF
  4881.                D$ = D$ + "MY=" + STR$(Y)
  4882.                L = LEN(D$)
  4883.                IF L < 20 THEN
  4884.                  D$ = D$ + STRING$(16 - L, 32)
  4885.                END IF
  4886.                D$ = D$ + "Number Of Times=" + STR$(N)
  4887.                DRWSTRING 1, 15, 8, D$, 0, 0
  4888.                SDELAY 80
  4889.             WEND
  4890.             MOUSEEXIT
  4891.             VIDEOMODESET VMODE
  4892.             END
  4893.  
  4894.  
  4895.  
  4896.  
  4897.  
  4898.  
  4899.  
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  
  4905.  
  4906.  
  4907.  
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.                                                                          78
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.           MOUSEBUTRELEASE
  4940.  
  4941.             PROTOTYPE
  4942.  
  4943.             SUB MOUSEBUTRELEASE (ReqButton%, X%, Y%, Num%, MouseButs%)
  4944.  
  4945.             INPUT
  4946.  
  4947.             ReqButton - button for which information is requested
  4948.  
  4949.             OUTPUT
  4950.  
  4951.             no value returned
  4952.             X, Y - current location of mouse cursor
  4953.             Num - number of times button has been released since last
  4954.             request
  4955.             MouseButs - current status of mouse buttons
  4956.  
  4957.             USAGE
  4958.  
  4959.             MOUSEBUTRELEASE returns in Num the number of times a mouse
  4960.             button has been released since the last call to
  4961.             MOUSEBUTRELEASE.  In addition the current status of the mouse
  4962.             cursor and buttons is returned.  The position is returned in
  4963.             X, Y.  The buttons' status is held in MouseButs.  The left
  4964.             button is held in bit zero, right button in bit one and center
  4965.             button - for three button mice - in bit two.  Button status is
  4966.             most easily checked with a bitwise AND of MouseButs and the
  4967.             desired bit.  The button for which a history is desired is
  4968.             identified by the bits in ReqButton.  However, only one bit
  4969.             may be set.  Therefore, only the values of 1, 2 and 4 are
  4970.             permitted.  If more than one bit in ReqButton is set, the
  4971.             function will exit and no information will be returned.
  4972.  
  4973.             SEE ALSO
  4974.  
  4975.             MOUSEBUTPRESS, MOUSESTATUS
  4976.  
  4977.             EXAMPLE
  4978.  
  4979.             REM ENABLE, SHOW, MOUSE / DISPLAY LEFT BUTTON RELEASE HISTORY
  4980.             REM FOR THE LAST 2 SECONDS
  4981.             REM $INCLUDE: 'SVGABC.BI'
  4982.             DEFINT A-Z
  4983.  
  4984.             VMODE = VIDEOMODEGET
  4985.             IF WHICHVGA = 0 THEN STOP
  4986.             IF WHICHMOUSE = 0 THEN STOP
  4987.             DUMMY=RES640
  4988.             MOUSEENTER
  4989.             MOUSESHOW
  4990.             WHILE INKEY$ = ""
  4991.                MOUSEBUTRELEASE 1, X, Y, N, MBUTS
  4992.                D$ = "MX=" + STR$(X)
  4993.  
  4994.  
  4995.                                                                          79
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.                L = LEN(D$)
  5002.                IF L < 10 THEN
  5003.                D$ = D$ + STRING$(8 - L, 32)
  5004.                END IF
  5005.                D$ = D$ + "MY=" + STR$(Y)
  5006.                L = LEN(D$)
  5007.                IF L < 20 THEN
  5008.                  D$ = D$ + STRING$(16 - L, 32)
  5009.                END IF
  5010.                D$ = D$ + "Number Of Times=" + STR$(N)
  5011.                DRWSTRING 1, 15, 8, D$, 0, 0
  5012.                SDELAY 80
  5013.             WEND
  5014.             MOUSEEXIT
  5015.             VIDEOMODESET VMODE
  5016.             END
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.  
  5026.  
  5027.  
  5028.  
  5029.  
  5030.  
  5031.  
  5032.  
  5033.  
  5034.  
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054.  
  5055.  
  5056.  
  5057.                                                                          80
  5058.  
  5059.  
  5060.  
  5061.  
  5062.  
  5063.           MOUSECURSORDEFAULT
  5064.  
  5065.             PROTOTYPE
  5066.  
  5067.             SUB MOUSECURSORDEFAULT ()
  5068.  
  5069.             INPUT
  5070.  
  5071.             no input parameters
  5072.  
  5073.             OUTPUT
  5074.  
  5075.             no value returned
  5076.  
  5077.             USAGE
  5078.  
  5079.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  5080.             arrow with the hot spot in the upper, left corner.  This is
  5081.             the cursor set when MOUSEENTER is called.
  5082.  
  5083.             SEE ALSO
  5084.  
  5085.             MOUSECURSORSET, MOUSEENTER
  5086.  
  5087.             EXAMPLE
  5088.  
  5089.             See MOUSECURSORSET
  5090.  
  5091.  
  5092.  
  5093.  
  5094.  
  5095.  
  5096.  
  5097.  
  5098.  
  5099.  
  5100.  
  5101.  
  5102.  
  5103.  
  5104.  
  5105.  
  5106.  
  5107.  
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.                                                                          81
  5120.  
  5121.  
  5122.  
  5123.  
  5124.  
  5125.           MOUSECURSORSET
  5126.  
  5127.             PROTOTYPE
  5128.  
  5129.             SUB MOUSECURSORSET (MouseCursor$)
  5130.  
  5131.             INPUT
  5132.  
  5133.             MouseCursor$ - string * 386 containing mouse cursor data
  5134.  
  5135.             OUTPUT
  5136.  
  5137.             no value returned
  5138.  
  5139.             USAGE
  5140.  
  5141.             MOUSECURSORSET defines the cursor according to the data in
  5142.             MouseCursor$.  The hot spot X and Y location for the cursor is
  5143.             defined by the first two bytes of MouseCursor$.  The values
  5144.             for the hot spot must be within the cursor.  Valid values are
  5145.             from 0 to 15 for the X location and from 0 to 23 for the Y
  5146.             location.
  5147.  
  5148.             SEE ALSO
  5149.  
  5150.             MOUSECURSORDEFAULT, MOUSEENTER, MOUSESHOW
  5151.  
  5152.             EXAMPLE
  5153.  
  5154.             REM MAKE A BIG CURSOR, THEN RESTORE IT BACK TO THE DEFAULT
  5155.             REM $INCLUDE: 'SVGABC.BI'
  5156.             DEFINT A-Z
  5157.  
  5158.             VMODE = VIDEOMODEGET
  5159.             IF WHICHVGA = 0 THEN STOP
  5160.             IF WHICHMEM < 512 THEN STOP
  5161.             IF WHICHMOUSE = 0 THEN STOP
  5162.             DUMMY=RES640
  5163.             MOUSEENTER
  5164.             DIM BIGMOUSECURSOR AS STRING * 386
  5165.             FOR I = 1 TO 386
  5166.                READ A
  5167.                MID$(BIGMOUSECURSOR, I, 1) = CHR$(A)
  5168.             NEXT I
  5169.             MOUSECURSORSET BIGMOUSECURSOR
  5170.             MOUSERANGESET 0, 0, 639, 400
  5171.             MOUSESHOW
  5172.             A$ = "Press A Key To Return To The Default Cursor"
  5173.             DRWSTRING 1, 7, 0, A$, 0, 420
  5174.             WHILE INKEY$ = ""
  5175.             WEND
  5176.             MOUSECURSORDEFAULT
  5177.             A$ = "Press A Key To End                         "
  5178.             DRWSTRING 1, 7, 0, A$, 0, 420
  5179.  
  5180.  
  5181.                                                                          82
  5182.  
  5183.  
  5184.  
  5185.  
  5186.  
  5187.             WHILE INKEY$ = ""
  5188.             WEND
  5189.             MOUSEEXIT
  5190.             VIDEOMODESET VMODE
  5191.             END
  5192.  
  5193.             REM *BIG ARROW MOUSE CURSOR DATA
  5194.             DATA 2,2
  5195.             DATA 0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255
  5196.             DATA 0,15,15,0,0,255,255,255,255,255,255,255,255,255,255,255
  5197.             DATA 0,15,15,15,15,0,0,0,255,255,255,255,255,255,255,255
  5198.             DATA 0,15,15,15,15,15,15,15,0,0,255,255,255,255,255,255
  5199.             DATA 0,15,15,15,15,15,15,15,15,15,0,0,0,255,255,255
  5200.             DATA 0,15,15,15,15,15,15,15,15,15,15,15,15,0,0,255
  5201.             DATA 0,15,15,15,15,15,15,15,15,15,15,15,15,15,0,255
  5202.             DATA 0,15,15,15,15,15,15,15,15,15,15,15,0,0,255,255
  5203.             DATA 0,15,15,15,15,15,15,15,15,15,15,0,255,255,255,255
  5204.             DATA 0,15,15,15,15,15,15,15,15,0,0,255,255,255,255,255
  5205.             DATA 0,15,15,15,15,15,15,15,15,0,255,255,255,255,255,255
  5206.             DATA 0,15,15,15,15,15,0,15,15,15,0,255,255,255,255,255
  5207.             DATA 0,15,15,15,15,0,0,15,15,15,0,255,255,255,255,255
  5208.             DATA 0,15,15,0,0,255,255,0,15,15,15,0,255,255,255,255
  5209.             DATA 0,15,0,255,255,255,255,0,15,15,15,0,255,255,255,255
  5210.             DATA 0,0,255,255,255,255,255,255,0,15,15,15,0,255,255,255
  5211.             DATA 255,255,255,255,255,255,255,255,255,0,15,15,15,0,255,255
  5212.             DATA 255,255,255,255,255,255,255,255,255,0,15,15,15,0,255,255
  5213.             DATA 255,255,255,255,255,255,255,255,255,255,0,15,15,15,0,255
  5214.             DATA 255,255,255,255,255,255,255,255,255,255,255,0,15,15,15,0
  5215.             DATA 255,255,255,255,255,255,255,255,255,255,255,0,15,15,15,0
  5216.             DATA 255,255,255,255,255,255,255,255,255,255,255,255,0,15,15,0
  5217.             DATA 255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0
  5218.             DATA
  5219.             255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,25
  5220.             5
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227.  
  5228.  
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.  
  5241.  
  5242.  
  5243.                                                                          83
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.           MOUSEENTER
  5250.  
  5251.             PROTOTYPE
  5252.  
  5253.             SUB MOUSEENTER ()
  5254.  
  5255.             INPUT
  5256.  
  5257.             no input parameters
  5258.  
  5259.             OUTPUT
  5260.  
  5261.             no value returned
  5262.  
  5263.             USAGE
  5264.  
  5265.             MOUSEENTER must be called before any other mouse functions.
  5266.             It initializes all of the mouse abilities including installing
  5267.             the Zephyr mouse display driver.  MOUSEENTER initializes the
  5268.             default mouse cursor, the default sensitivity and sets the
  5269.             range to the current screen resolution.  The mouse cursor
  5270.             location is set to the middle of the screen.
  5271.  
  5272.             SEE ALSO
  5273.  
  5274.             MOUSEEXIT, MOUSEHIDE, MOUSESHOW
  5275.  
  5276.             EXAMPLE
  5277.  
  5278.             REM ENABLE AND SHOW THE MOUSE
  5279.             REM $INCLUDE: 'SVGABC.BI'
  5280.             DEFINT A-Z
  5281.  
  5282.             VMODE = VIDEOMODEGET
  5283.             IF WHICHVGA = 0 THEN STOP
  5284.             IF WHICHMOUSE = 0 THEN STOP
  5285.             DUMMY=RES640
  5286.             MOUSEENTER
  5287.             MOUSESHOW
  5288.             WHILE INKEY$ = ""
  5289.             WEND
  5290.             MOUSEEXIT
  5291.             VIDEOMODESET VMODE
  5292.             END
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.  
  5303.  
  5304.  
  5305.                                                                          84
  5306.  
  5307.  
  5308.  
  5309.  
  5310.  
  5311.           MOUSEEXIT
  5312.  
  5313.             PROTOTYPE
  5314.  
  5315.             SUB MOUSEEXIT ()
  5316.  
  5317.             INPUT
  5318.  
  5319.             no input parameters
  5320.  
  5321.             OUTPUT
  5322.  
  5323.             no value returned
  5324.  
  5325.             USAGE
  5326.  
  5327.             MOUSEEXIT properly disables all of the mouse abilities.  This
  5328.             function also removes the Zephyr mouse display driver.  This
  5329.             function should be called prior to exiting any program that
  5330.             previously called MOUSEENTER.
  5331.  
  5332.             SEE ALSO
  5333.  
  5334.             MOUSEENTER, MOUSEHIDE, MOUSESHOW
  5335.  
  5336.             EXAMPLE
  5337.  
  5338.             See MOUSEENTER
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.  
  5364.  
  5365.  
  5366.  
  5367.                                                                          85
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.           MOUSEHIDE
  5374.  
  5375.             PROTOTYPE
  5376.  
  5377.             SUB MOUSEHIDE ()
  5378.  
  5379.             INPUT
  5380.  
  5381.             no input parameters
  5382.  
  5383.             OUTPUT
  5384.  
  5385.             no value returned
  5386.  
  5387.             USAGE
  5388.  
  5389.             MOUSEHIDE turns off the mouse display driver and removes the
  5390.             cursor from the display.  It is recommended to hide the mouse
  5391.             any time something will be drawn in its general vicinity.
  5392.             Note, however, that although the cursor is not visible, all
  5393.             other mouse abilities remain active.
  5394.  
  5395.             SEE ALSO
  5396.  
  5397.             MOUSEENTER, MOUSEEXIT, MOUSESHOW
  5398.  
  5399.             EXAMPLE
  5400.  
  5401.             REM ENABLE, SHOW, AND THE HIDE THE MOUSE
  5402.             REM $INCLUDE: 'SVGABC.BI'
  5403.             DEFINT A-Z
  5404.  
  5405.             VMODE = VIDEOMODEGET
  5406.             IF WHICHVGA = 0 THEN STOP
  5407.             IF WHICHMOUSE = 0 THEN STOP
  5408.             DUMMY=RES640
  5409.  
  5410.             MOUSEENTER
  5411.             MOUSESHOW
  5412.             WHILE INKEY$ = ""
  5413.             WEND
  5414.             MOUSEHIDE
  5415.  
  5416.             WHILE INKEY$ = ""
  5417.             WEND
  5418.             MOUSEEXIT
  5419.             VIDEOMODESET VMODE
  5420.  
  5421.             END
  5422.  
  5423.  
  5424.  
  5425.  
  5426.  
  5427.  
  5428.  
  5429.                                                                          86
  5430.  
  5431.  
  5432.  
  5433.  
  5434.  
  5435.           MOUSEINFO
  5436.  
  5437.             PROTOTYPE
  5438.  
  5439.             SUB MOUSEINFO (MajorVersion%, MinorVersion%, MouseType%, IRQ%)
  5440.  
  5441.             INPUT
  5442.  
  5443.             no input parameters
  5444.  
  5445.             OUTPUT
  5446.  
  5447.             no value returned
  5448.             MajorVersion - Microsoft compatible mouse driver major version
  5449.             number
  5450.             MinorVersion - Microsoft compatible mouse driver minor version
  5451.             number
  5452.             MouseType - type of mouse installed
  5453.             IRQ - the interrupt used by the mouse
  5454.  
  5455.             USAGE
  5456.  
  5457.             MOUSEINFO returns information about the mouse and its
  5458.             installed driver.  The driver must be Microsoft compatible.
  5459.             This information can be used to determine whether the mouse
  5460.             functions in this library will operate correctly.  For proper
  5461.             operation the driver version number must be greater than 1.00.
  5462.             IRQ gives the interrupt number of the mouse - probably 3 or 4.
  5463.             MouseType returns information about the type of hardware
  5464.             installed according to the following table:
  5465.  
  5466.             0 =  unknown type
  5467.             1 =  bus mouse
  5468.             2 =  serial mouse
  5469.             3 =  Inport mouse
  5470.             4 =  PS/2 mouse
  5471.             5 =  HP mouse
  5472.  
  5473.             SEE ALSO
  5474.  
  5475.             WHICHMOUSE
  5476.  
  5477.             EXAMPLE
  5478.  
  5479.             REM RETURN INFORMATION ABOUT THE MOUSE
  5480.             REM $INCLUDE: 'SVGABC.BI'
  5481.             DEFINT A-Z
  5482.  
  5483.             CLS
  5484.             MOUSE = WHICHMOUSE
  5485.             IF MOUSE > 0 THEN
  5486.                MOUSEINFO MJV, MNV, TP, I
  5487.                VER$ = STR$(MNV)
  5488.                L = LEN(VER$)
  5489.  
  5490.  
  5491.                                                                          87
  5492.  
  5493.  
  5494.  
  5495.  
  5496.  
  5497.                VER$ = STR$(MJV) + "." + RIGHT$(VER$, L - 1)
  5498.                VER$ = "Software driver version is" + VER$
  5499.                VER$ = VER$ + " (Microsoft equivalent version)."
  5500.                SELECT CASE TP
  5501.                  CASE IS = 1
  5502.                     TYPE$ = "bus mouse"
  5503.                  CASE IS = 2
  5504.                     TYPE$ = "serial mouse"
  5505.                  CASE IS = 3
  5506.                     TYPE$ = "Inport mouse"
  5507.                  CASE IS = 4
  5508.                     TYPE$ = "PS/2 mouse"
  5509.                  CASE IS = 5
  5510.                     TYPE$ = "HP mouse"
  5511.                  CASE ELSE
  5512.                     TYPE$ = "unknown type"
  5513.                END SELECT
  5514.                PRINT "Microsoft compatible " + TYPE$ + " detected with";
  5515.                PRINT STR$(MOUSE) + " buttons on IRQ" + STR$(I) + "."
  5516.                PRINT VER$
  5517.             ELSE
  5518.                PRINT "No Microsoft compatible mouse detected."
  5519.             END IF
  5520.             PRINT
  5521.             WHILE INKEY$ = ""
  5522.             WEND
  5523.             END
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.  
  5553.                                                                          88
  5554.  
  5555.  
  5556.  
  5557.  
  5558.  
  5559.           MOUSELOCSET
  5560.  
  5561.             PROTOTYPE
  5562.  
  5563.             SUB MOUSELOCSET (X%, Y%)
  5564.  
  5565.             INPUT
  5566.  
  5567.             X, Y - location on screen
  5568.  
  5569.             OUTPUT
  5570.  
  5571.             no value returned
  5572.  
  5573.             USAGE
  5574.  
  5575.             MOUSELOCSET moves the mouse cursor the location on the screen
  5576.             specified by X, Y.  If either X or Y is outside of the
  5577.             currently permitted mouse range, it is set to the closest
  5578.             border.  The currently permitted mouse range is the current
  5579.             screen resolution or the last called MOUSERANGESET.
  5580.  
  5581.             SEE ALSO
  5582.  
  5583.             MOUSEENTER, MOUSERANGESET
  5584.  
  5585.             EXAMPLE
  5586.  
  5587.             REM ENABLE AND SHOW THE MOUSE THEN MOVE IT TO THE ORIGIN
  5588.             REM $INCLUDE: 'SVGABC.BI'
  5589.             DEFINT A-Z
  5590.  
  5591.             VMODE = VIDEOMODEGET
  5592.             IF WHICHVGA = 0 THEN STOP
  5593.             IF WHICHMOUSE = 0 THEN STOP
  5594.             DUMMY=RES640
  5595.             MOUSEENTER
  5596.             MOUSESHOW
  5597.             WHILE INKEY$ = ""
  5598.             WEND
  5599.             MOUSELOCSET 0, 0
  5600.             WHILE INKEY$ = ""
  5601.             WEND
  5602.             MOUSEEXIT
  5603.             VIDEOMODESET VMODE
  5604.             END
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.                                                                          89
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.           MOUSERANGESET
  5622.  
  5623.             PROTOTYPE
  5624.  
  5625.             SUB MOUSERANGESET (X1%, Y1%, X2%, Y2%)
  5626.  
  5627.             INPUT
  5628.  
  5629.             X1, Y1 - location on screen of top, left corner of range
  5630.             X2, Y2 - location on screen of bottom, right corner of range
  5631.  
  5632.             OUTPUT
  5633.  
  5634.             no value returned
  5635.  
  5636.             USAGE
  5637.  
  5638.             MOUSERANGESET defines a permissible range on the screen for
  5639.             mouse movement.  The mouse is automatically positioned in the
  5640.             center of this range.
  5641.  
  5642.             SEE ALSO
  5643.  
  5644.             MOUSELOCSET, MOUSESTATUS
  5645.  
  5646.             EXAMPLE
  5647.  
  5648.             REM ENABLE, SHOW, AND SET A RANGE FOR THE MOUSE
  5649.             REM $INCLUDE: 'SVGABC.BI'
  5650.             DEFINT A-Z
  5651.  
  5652.             VMODE = VIDEOMODEGET
  5653.             IF WHICHVGA = 0 THEN STOP
  5654.             IF WHICHMOUSE = 0 THEN STOP
  5655.             DUMMY=RES640
  5656.             MOUSEENTER
  5657.             DRWBOX 1, 10, 100, 100, 539, 379
  5658.             MOUSERANGESET 100, 100, 539, 379
  5659.             MOUSESHOW
  5660.             WHILE INKEY$ = ""
  5661.             WEND
  5662.             MOUSEEXIT
  5663.             VIDEOMODESET VMODE
  5664.             END
  5665.  
  5666.  
  5667.  
  5668.  
  5669.  
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.                                                                          90
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.           MOUSERESTORESTATE
  5684.  
  5685.             PROTOTYPE
  5686.  
  5687.             SUB MOUSERESTORESTATE (MouseBuf%)
  5688.  
  5689.             INPUT
  5690.  
  5691.             MouseBuf - integer array holding complete mouse status
  5692.             information
  5693.  
  5694.             OUTPUT
  5695.  
  5696.             no value returned
  5697.  
  5698.             USAGE
  5699.  
  5700.             MOUSERESTORESTATE completely restores a previously saved mouse
  5701.             status as contained in MouseBuf.  The mouse status must have
  5702.             been already stored in MouseBuf by MOUSESAVESTATE.
  5703.  
  5704.             SEE ALSO
  5705.  
  5706.             MOUSESAVESTATE, MOUSESTORAGESIZE
  5707.  
  5708.             EXAMPLE
  5709.  
  5710.             REM SAVE THE CURRENT MOUSE DRIVER STATUS,SHELL OUT, RESTORE IT
  5711.             REM $INCLUDE: 'SVGABC.BI'
  5712.             DEFINT A-Z
  5713.  
  5714.             IF WHICHMOUSE = 0 THEN STOP
  5715.             BUFSIZE = MOUSESTORAGESIZE \ 2 + 1
  5716.             DIM MBUFFER(0 TO BUFSIZE) AS INTEGER
  5717.             MOUSESAVESTATE MBUFFER(0)
  5718.             PRINT "TYPE 'EXIT' TO RETURN TO THE PROGRAM"
  5719.             SHELL
  5720.             CLS
  5721.             MOUSERESTORESTATE MBUFFER(0)
  5722.             PRINT "DRIVER RESTORED..."
  5723.             WHILE INKEY$ = ""
  5724.             WEND
  5725.             END
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735.  
  5736.  
  5737.  
  5738.  
  5739.                                                                          91
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.           MOUSESAVESTATE
  5746.  
  5747.             PROTOTYPE
  5748.  
  5749.             SUB MOUSESAVESTATE (MouseBuf%)
  5750.  
  5751.             INPUT
  5752.  
  5753.             no input parameters
  5754.  
  5755.             OUTPUT
  5756.  
  5757.             no value returned
  5758.             MouseBuf - integer array holding complete mouse status
  5759.             information
  5760.  
  5761.             USAGE
  5762.  
  5763.             MOUSESAVESTATE saves the complete mouse status in MouseBuf.
  5764.             The size of MouseBuf in bytes is defined by MOUSESTORAGESIZE
  5765.             which should called first.
  5766.  
  5767.             SEE ALSO
  5768.  
  5769.             MOUSERESTORESTATE, MOUSESTORAGESIZE
  5770.  
  5771.             EXAMPLE
  5772.  
  5773.             See MOUSESAVESTATE
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801.                                                                          92
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.           MOUSESENSSET
  5808.  
  5809.             PROTOTYPE
  5810.  
  5811.             SUB MOUSESENSSET (XSens%, Ysens%, DblSpdTresh%)
  5812.  
  5813.             INPUT
  5814.  
  5815.             XSens - number of mickeys per 8 pixels horizontally (default =
  5816.             8 mickeys per 8 pixels)
  5817.             YSens - number of mickeys per 8 pixels vertically (default =
  5818.             16 mickeys per 8 pixels)
  5819.             DblSpdThresh = number of mickeys per second at which speed is
  5820.             doubled (default = 64)
  5821.  
  5822.             OUTPUT
  5823.  
  5824.             no value returned
  5825.  
  5826.             USAGE
  5827.  
  5828.             MOUSESENSSET defines the relationship between mouse movement
  5829.             and cursor movement on the screen.  A mickey is defined as
  5830.             1/200th of an inch.  The ratio between mickeys and pixels is
  5831.             specified by XSens and YSens in the horizontal and vertical
  5832.             directions respectively.  When the mouse movement is faster
  5833.             than DblSpdThresh in mickeys per second, the speed is doubled.
  5834.             The default values are assigned whenever MOUSEENTER or
  5835.             MOUSEEXIT are called.
  5836.  
  5837.             SEE ALSO
  5838.  
  5839.             MOUSEENTER, MOUSEEXIT, MOUSESTATUS
  5840.  
  5841.             EXAMPLE
  5842.  
  5843.             REM ENABLE, SHOW THE MOUSE AND MAKE IT VERY SENSITIVE
  5844.             REM $INCLUDE: 'SVGABC.BI'
  5845.             DEFINT A-Z
  5846.  
  5847.             VMODE = VIDEOMODEGET
  5848.             IF WHICHVGA = 0 THEN STOP
  5849.             IF WHICHMOUSE = 0 THEN STOP
  5850.             DUMMY=RES640
  5851.             MOUSEENTER
  5852.             MOUSESHOW
  5853.             MOUSESENSSET 50, 50, 10
  5854.             WHILE INKEY$ = ""
  5855.             WEND
  5856.             MOUSEEXIT
  5857.             VIDEOMODESET VMODE
  5858.             END
  5859.  
  5860.  
  5861.  
  5862.  
  5863.                                                                          93
  5864.  
  5865.  
  5866.  
  5867.  
  5868.  
  5869.           MOUSESHOW
  5870.  
  5871.             PROTOTYPE
  5872.  
  5873.             SUB MOUSESHOW ()
  5874.  
  5875.             INPUT
  5876.  
  5877.             no input parameters
  5878.  
  5879.             OUTPUT
  5880.  
  5881.             no value returned
  5882.  
  5883.             USAGE
  5884.  
  5885.             MOUSESHOW enables the mouse display driver and places the
  5886.             cursor on the screen.  The cursor is only updated when the
  5887.             mouse is moved.  Therefore, it is recommended to hide the
  5888.             cursor when drawing on the screen to avoid unexpected results.
  5889.  
  5890.             SEE ALSO
  5891.  
  5892.             MOUSEENTER, MOUSEEXIT, MOUSEHIDE
  5893.  
  5894.             EXAMPLE
  5895.  
  5896.             See MOUSEHIDE
  5897.  
  5898.  
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.                                                                          94
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.           MOUSESTATUS
  5932.  
  5933.             PROTOTYPE
  5934.  
  5935.             SUB MOUSESTATUS (X%, Y%, MouseButs%)
  5936.  
  5937.             INPUT
  5938.  
  5939.             no input parameters
  5940.  
  5941.             OUTPUT
  5942.  
  5943.             no value returned
  5944.             X, Y - mouse position on screen
  5945.             MouseButs - status of mouse buttons
  5946.  
  5947.             USAGE
  5948.  
  5949.             MOUSESTATUS returns the current status of the mouse position
  5950.             and buttons.  The position is returned in X, Y.  The buttons'
  5951.             status is held in MouseButs.  The left button is held in bit
  5952.             zero, right button in bit one and center button - for three
  5953.             button mice - in bit two.  Button status is most easily
  5954.             checked with a bitwise AND of MouseButs and the desired bit.
  5955.  
  5956.             SEE ALSO
  5957.  
  5958.             MOUSERANGESET, MOUSESENSSET
  5959.  
  5960.             EXAMPLE
  5961.  
  5962.             REM ENABLE, SHOW, DISPLAY MOUSE STATUS
  5963.             REM $INCLUDE: 'SVGABC.BI'
  5964.             DEFINT A-Z
  5965.             VMODE = VIDEOMODEGET
  5966.             IF WHICHVGA = 0 THEN STOP
  5967.             IF WHICHMOUSE = 0 THEN STOP
  5968.             DUMMY=RES640
  5969.             MOUSEENTER
  5970.             MOUSESHOW
  5971.             WHILE INKEY$ = ""
  5972.                MOUSESTATUS X, Y, MButs
  5973.                D$ = "MX=" + STR$(X)
  5974.                L = LEN(D$)
  5975.                IF L < 10 THEN
  5976.                  D$ = D$ + STRING$(8 - L, 32)
  5977.                END IF
  5978.                D$ = D$ + "MY=" + STR$(Y)
  5979.                L = LEN(D$)
  5980.                IF L < 20 THEN
  5981.                  D$ = D$ + STRING$(16 - L, 32)
  5982.                END IF
  5983.                D$ = D$ + "MBUTS=" + STR$(MButs)
  5984.                DRWSTRING 1, 15, 8, D$, 0, 0
  5985.  
  5986.  
  5987.                                                                          95
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.             WEND
  5994.             MOUSEEXIT
  5995.             VIDEOMODESET VMODE
  5996.             END
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.                                                                          96
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.           MOUSESTORAGESIZE
  6056.  
  6057.             PROTOTYPE
  6058.  
  6059.             FUNCTION MOUSESTORAGESIZE% ()
  6060.  
  6061.             INPUT
  6062.  
  6063.             no input parameters
  6064.  
  6065.             OUTPUT
  6066.  
  6067.             MOUSESTORAGESIZE returns the number of bytes needed to store
  6068.             the complete mouse status.
  6069.  
  6070.             USAGE
  6071.  
  6072.             MOUSESTORAGESIZE determines the proper size buffer to hold the
  6073.             complete mouse status information.  This buffer should be
  6074.             created before calling MOUSESAVESTATE.
  6075.  
  6076.             SEE ALSO
  6077.  
  6078.             MOUSERESTORESTATE, MOUSESAVESTATE
  6079.  
  6080.             EXAMPLE
  6081.  
  6082.             REM RETURN THE SIZE IN BYTES NEEDED TO SAVE THE MOUSE STATUS
  6083.             REM $INCLUDE: 'SVGABC.BI'
  6084.             DEFINT A-Z
  6085.  
  6086.             CLS
  6087.             IF WHICHMOUSE = 0 THEN STOP
  6088.             A$ = "The Mouse Driver Requires A" + STR$(MOUSESTORAGESIZE) +
  6089.             " Byte Buffer "
  6090.             A$ = A$ + "To Save Current Status."
  6091.             PRINT A$
  6092.             PRINT
  6093.             WHILE INKEY$ = ""
  6094.             WEND
  6095.             END
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.                                                                          97
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.           OVERSCANSET
  6118.  
  6119.             PROTOTYPE
  6120.  
  6121.             SUB OVERSCANSET (Color%)
  6122.  
  6123.             INPUT
  6124.  
  6125.             Color - index to color in current palette
  6126.  
  6127.             OUTPUT
  6128.  
  6129.             no value returned
  6130.  
  6131.             USAGE
  6132.  
  6133.             OVERSCANSET sets the overscan region to the specified color.
  6134.             The overscan region is the area between the usable pixel area
  6135.             and the region not scanned by the monitor.  Normally, the
  6136.             overscan is color zero which is defined as black the majority
  6137.             of the time.  The overscan color is reset to zero anytime a
  6138.             RES### function is called.
  6139.  
  6140.             Note: OVERSCANSET always works in the 320x200 resolution.  In
  6141.             the higher resolutions on many common SVGA cards this function
  6142.             is ignored.  Instead, the card always assigns the overscan
  6143.             region to color zero.  Therefore, it is recommended to not use
  6144.             OVERSCANSET, but assign color zero as needed.
  6145.  
  6146.             EXAMPLE
  6147.  
  6148.             REM SET THE OVERSCAN COLOR TO GREEN
  6149.             REM $INCLUDE: 'SVGABC.BI'
  6150.             DEFINT A-Z
  6151.             VMODE = VIDEOMODEGET
  6152.             IF WHICHVGA = 0 THEN STOP
  6153.             RES320
  6154.             OVERSCANSET 10
  6155.             WHILE INKEY$ = ""
  6156.             WEND
  6157.             VIDEOMODESET VMODE
  6158.             END
  6159.  
  6160.  
  6161.  
  6162.  
  6163.  
  6164.  
  6165.  
  6166.  
  6167.  
  6168.  
  6169.  
  6170.  
  6171.  
  6172.  
  6173.                                                                          98
  6174.  
  6175.  
  6176.  
  6177.  
  6178.  
  6179.           PAGEACTIVE
  6180.  
  6181.             PROTOTYPE
  6182.  
  6183.             FUNCTION PAGEACTIVE (Page%)
  6184.  
  6185.             INPUT
  6186.  
  6187.             Page - number of page to make active
  6188.  
  6189.             OUTPUT
  6190.  
  6191.             PAGEACTIVE returns a 1 if successful, 0 if unsuccessful.
  6192.  
  6193.             USAGE
  6194.  
  6195.             PAGEACTIVE sets the active page as specified by Page.  It
  6196.             works by creating an offset to be added when any bank
  6197.             switching is performed.  This function does not affect the
  6198.             actual display.  A page is defined as the number of 64K blocks
  6199.             necessary to contain the current screen resolution.  For
  6200.             example, 640x480 requires 307,200 bytes which is a little more
  6201.             than 4.5 64K blocks.  One page in this resolution will be 5
  6202.             banks.
  6203.  
  6204.             PAGEACTIVE does not work in 320x200 mode since this mode uses
  6205.             no bank switching.
  6206.  
  6207.             SEE ALSO
  6208.  
  6209.             PAGEDISPLAY
  6210.  
  6211.             EXAMPLE
  6212.  
  6213.             REM SHOW PAGEACTIVE FUNCTION
  6214.             REM THIS EXAMPLE REQUIRES 1 MEG OF VIDEO MEMORY
  6215.             REM $INCLUDE: 'SVGABC.BI'
  6216.             DEFINT A-Z
  6217.  
  6218.             IF WHICHVGA = 0 THEN
  6219.                END
  6220.             END IF
  6221.             IF WHICHMEM < 1024 THEN
  6222.                END
  6223.             END IF
  6224.             IF RES640 = 0 THEN
  6225.                END
  6226.             END IF
  6227.  
  6228.             REM MAKE SURE VIDEO CARD SUPPORTS PAGE FLIPPING
  6229.             IF PAGEDISPLAY(0, 0, 0) = 0 THEN
  6230.                DUMMY = RESTEXT
  6231.             END
  6232.             END IF
  6233.  
  6234.  
  6235.                                                                          99
  6236.  
  6237.  
  6238.  
  6239.  
  6240.  
  6241.             DUMMY = PAGEACTIVE(0)
  6242.             FILLPAGE 0
  6243.             DRWSTRING 1, 10, 0, "PAGE 0", 0, 0
  6244.             DRWSTRING 1, 10, 0, "PRESS A KEY...", 0, 300
  6245.             DUMMY = PAGEACTIVE(1)
  6246.             FILLPAGE 0
  6247.             DRWSTRING 1, 12, 0, "PAGE 1", 0, 20
  6248.             DRWSTRING 1, 12, 0, "PRESS A KEY...", 0, 300
  6249.             DUMMY = PAGEACTIVE(2)
  6250.             FILLPAGE 0
  6251.             DRWSTRING 1, 13, 0, "PAGE 2", 0, 40
  6252.             DRWSTRING 1, 13, 0, "PRESS A KEY...", 0, 300
  6253.             DUMMY = PAGEDISPLAY(0, 0, 0)
  6254.             WHILE INKEY$ = ""
  6255.             WEND
  6256.             DUMMY = PAGEDISPLAY(0, 0, 1)
  6257.             WHILE INKEY$ = ""
  6258.             WEND
  6259.             DUMMY = PAGEDISPLAY(0, 0, 2)
  6260.             WHILE INKEY$ = ""
  6261.             WEND
  6262.             DUMMY = RESTEXT
  6263.             CLS
  6264.             END
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.  
  6279.  
  6280.  
  6281.  
  6282.  
  6283.  
  6284.  
  6285.  
  6286.  
  6287.  
  6288.  
  6289.  
  6290.  
  6291.  
  6292.  
  6293.  
  6294.  
  6295.  
  6296.  
  6297.                                                                         100
  6298.  
  6299.  
  6300.  
  6301.  
  6302.  
  6303.           PAGEDISPLAY
  6304.  
  6305.             PROTOTYPE
  6306.  
  6307.             FUNCTION PAGEDISPLAY (X%, Y%, Page%)
  6308.  
  6309.             INPUT
  6310.  
  6311.             X, Y - coordinate to place at top, left of display
  6312.             Page - number of page to make active
  6313.  
  6314.             OUTPUT
  6315.  
  6316.             PAGEACTIVE returns a 1 if successful, 0 if unsuccessful.
  6317.  
  6318.             USAGE
  6319.  
  6320.             PAGEDISPLAY tells the video card where in video memory to
  6321.             begin the display.  This display offset is calculated from the
  6322.             specified Page, X and Y.  This is done by multiplying Y times
  6323.             the width of the current resolution, adding X and then adding
  6324.             the appropriate number of 64K blocks for Page.  X, Y and Page
  6325.             must all be positive numbers, but are otherwise not
  6326.             restricted.  The display will wrap if the values are
  6327.             abnormally large.  Wrapping will happen from side to side as
  6328.             well as from top of memory to bottom of memory.
  6329.  
  6330.             PAGEDISPLAY does not work in 320x200 mode since this mode uses
  6331.             no bank switching.  In addition, older models of some SVGA
  6332.             cards operating in native mode do not support paging.  In this
  6333.             library these cards are: Acumos, Ahead version A, Everex and
  6334.             Genoa.  To ensure compatibility, a program should make a call
  6335.             similar to:
  6336.  
  6337.             RET = PAGEDISPLAY(0,0,0)
  6338.             IF RET = 0 THEN PRINT "PAGING NOT SUPPORTED"
  6339.  
  6340.             Note: SVGA cards by ATI Technologies appear to ignore bit 4
  6341.             (counting from 0 to 19) in its linear addressing mode and
  6342.             assume it is zero.  Therefore, bit 4 of the x parameter will
  6343.             be ignored by ATI chipsets.
  6344.  
  6345.             SEE ALSO
  6346.  
  6347.             PAGEACTIVE
  6348.  
  6349.             EXAMPLE
  6350.  
  6351.             See PAGEACTIVE
  6352.  
  6353.  
  6354.  
  6355.  
  6356.  
  6357.  
  6358.  
  6359.                                                                         101
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.           PALCHGAUTO
  6366.  
  6367.             PROTOTYPE
  6368.  
  6369.             SUB PALCHGAUTO (Pal$, NewPal$, FirstColor%, LastColor%,
  6370.             Speed%)
  6371.  
  6372.             INPUT
  6373.  
  6374.             Pal$ - string * 768 containing initial palette
  6375.             NewPal$ - string *768 containing new palette
  6376.             FirstColor - index into palette where change will begin
  6377.             LastColor - index into palette where change will end
  6378.             Speed - speed of change
  6379.  
  6380.             OUTPUT
  6381.  
  6382.             no value returned
  6383.  
  6384.             USAGE
  6385.  
  6386.             PALCHGAUTO smoothly fades the colors between FirstColor and
  6387.             LastColor from the palette Pal$ to NewPal$.  The speed of the
  6388.             fade is set by Speed which is percentage change between each
  6389.             step of the fade.  Only values between 1 and 128 are valid
  6390.             where 1 represents a one percent change between steps and 128
  6391.             (80 hex) represents fifty percent change between steps.  A
  6392.             Speed of 128 would then have only two steps.  A Speed outside
  6393.             of the valid range causes the function to immediately return
  6394.             without making any changes.  The time required to accomplish
  6395.             the entire fade is approximately equal to 0.033 seconds times
  6396.             256 divided by Speed.  PALCHGAUTO does not modify either Pal$
  6397.             or NewPal$.
  6398.  
  6399.             SEE ALSO
  6400.  
  6401.             PALCHGSTEP, PALDIMSTEP, PALIOAUTO
  6402.  
  6403.             EXAMPLE
  6404.  
  6405.             REM AUTOFADE FROM ONE PALETTE TO ANOTHER AND BACK AGAIN
  6406.             REM $INCLUDE: 'SVGABC.BI'
  6407.             DEFINT A-Z
  6408.             DIM PAL AS STRING * 768
  6409.             DIM NEWPAL AS STRING * 768
  6410.  
  6411.             VMODE = VIDEOMODEGET
  6412.             IF WHICHVGA = 0 THEN STOP
  6413.             IF WHICHMEM < 512 THEN STOP
  6414.             DUMMY=RES640
  6415.             PALGET PAL, 0, 255
  6416.             FOR I = 1 TO 768
  6417.                MID$(NEWPAL, I, 1) = MID$(PAL, 769 - I, 1)
  6418.             NEXT I
  6419.  
  6420.  
  6421.                                                                         102
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.             COLR = 0
  6428.             FOR I = 0 TO 639
  6429.                DRWLINE 1, COLR, I, 0, I, 479
  6430.                COLR = COLR + 1
  6431.                IF COLR > 255 THEN
  6432.                  COLR = 0
  6433.                END IF
  6434.             NEXT I
  6435.             PALCHGAUTO PAL, NEWPAL, 0, 255, 2
  6436.             PALCHGAUTO NEWPAL, PAL, 0, 255, 2
  6437.             WHILE INKEY$ = ""
  6438.             WEND
  6439.             VIDEOMODESET VMODE
  6440.             END
  6441.  
  6442.  
  6443.  
  6444.  
  6445.  
  6446.  
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.                                                                         103
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.           PALCHGSTEP
  6490.  
  6491.             PROTOTYPE
  6492.  
  6493.             SUB PALCHGSTEP (Pal$, NewPal$, FirstColor%, LastColor%,
  6494.             Percent%)
  6495.  
  6496.             INPUT
  6497.  
  6498.             Pal$ - string * 768 containing initial palette
  6499.             NewPal$ - string * 768 containing new palette
  6500.             FirstColor - index into palette where change will begin
  6501.             LastColor - index into palette where change will end
  6502.             Percent - percent step from current palette to new palette
  6503.  
  6504.             OUTPUT
  6505.  
  6506.             no value returned
  6507.  
  6508.             USAGE
  6509.  
  6510.             PALCHGSTEP changes the palette colors between FirstColor and
  6511.             LastColor by Percent from Pal$ to NewPal$.  This function
  6512.             works very much like PALCHGAUTO except it only takes a single
  6513.             step and returns.  The step taken is a percentage specified by
  6514.             Percent where 256 (100 hex) is a 100 percent change.  The
  6515.             valid range for Percent is 0 to 256.  Values beyond this range
  6516.             cause the function to immediately return without making any
  6517.             changes.  A loop from 4 to 256 by fours using PALCHGSTEP would
  6518.             have similar results as PALCHGAUTO with a speed of 4.  Neither
  6519.             Pal$, nor NewPal$ are modified.
  6520.  
  6521.             SEE ALSO
  6522.  
  6523.             PALCHGAUTO, PALDIMSTEP, PALIOAUTO
  6524.  
  6525.             EXAMPLE
  6526.  
  6527.             REM STEP FADE FROM ONE PALETTE TO ANOTHER AND BACK AGAIN FAST
  6528.             REM $INCLUDE: 'SVGABC.BI'
  6529.             DEFINT A-Z
  6530.             DIM PAL AS STRING * 768
  6531.             DIM NEWPAL AS STRING * 768
  6532.  
  6533.             VMODE = VIDEOMODEGET
  6534.             IF WHICHVGA = 0 THEN STOP
  6535.             IF WHICHMEM < 512 THEN STOP
  6536.             DUMMY=RES640
  6537.             PALGET PAL, 0, 255
  6538.             FOR I = 1 TO 768
  6539.                MID$(NEWPAL, I, 1) = MID$(PAL, 769 - I, 1)
  6540.             NEXT I
  6541.             COLR = 0
  6542.             FOR I = 0 TO 639
  6543.  
  6544.  
  6545.                                                                         104
  6546.  
  6547.  
  6548.  
  6549.  
  6550.  
  6551.                DRWLINE 1, COLR, I, 0, I, 479
  6552.                COLR = COLR + 1
  6553.                IF COLR > 255 THEN
  6554.                  COLR = 0
  6555.                END IF
  6556.             NEXT I
  6557.             FOR I = 1 TO 255 STEP 2
  6558.                PALCHGSTEP PAL, NEWPAL, 0, 255, I
  6559.             NEXT I
  6560.             FOR I = 1 TO 255 STEP 16
  6561.                PALCHGSTEP NEWPAL, PAL, 0, 255, I
  6562.             NEXT I
  6563.             WHILE INKEY$ = ""
  6564.             WEND
  6565.             VIDEOMODESET VMODE
  6566.             END
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.                                                                         105
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.           PALCOPY
  6614.  
  6615.             PROTOTYPE
  6616.  
  6617.             SUB PALCOPY (SrcPalette$, DestPalette$, FirstColor%,
  6618.             LastColor%)
  6619.  
  6620.             INPUT
  6621.  
  6622.             SrcPalette$ - string * 768 containing source palette
  6623.             FirstColor - index into palette where copy will begin
  6624.             LastColor - index into palette where copy will end
  6625.  
  6626.             OUTPUT
  6627.  
  6628.             no value returned
  6629.             DestPalette$ - string * 768 containing copy of source palette
  6630.  
  6631.             USAGE
  6632.  
  6633.             PALCOPY quickly copies a source palette into a second palette
  6634.             array.  The source and destination must both be defined as
  6635.             string * 768 or PALCOPY will return without making any copy.
  6636.             A portion of a palette may be copied by specifying first and
  6637.             last colors.
  6638.  
  6639.             SEE ALSO
  6640.  
  6641.             BYTECOPY
  6642.  
  6643.             EXAMPLE
  6644.  
  6645.             REM SHOW PAL COPY
  6646.             REM $INCLUDE: 'SVGABC.BI'
  6647.             DEFINT A-Z
  6648.             DIM PAL1 AS STRING * 768
  6649.             DIM PAL2 AS STRING * 768
  6650.             VMODE = VIDEOMODEGET
  6651.             IF WHICHVGA = 0 THEN STOP
  6652.             IF WHICHMEM < 512 THEN STOP
  6653.             DUMMY = RES640
  6654.             FOR I = 0 TO 255
  6655.                MID$(PAL1, I * 3 + 1, 1) = CHR$(I)
  6656.                MID$(PAL1, I * 3 + 2, 1) = CHR$(I)
  6657.                MID$(PAL1, I * 3 + 3, 1) = CHR$(I)
  6658.             NEXT I
  6659.             COLR = 0
  6660.             FOR I = 0 TO 639
  6661.                DRWLINE 1, COLR, I, 0, I, 479
  6662.                COLR = COLR + 1
  6663.                IF COLR > 255 THEN COLR = 0
  6664.             NEXT I
  6665.             PALCOPY PAL1, PAL2, 0, 255
  6666.             PALSET PAL2, 0, 255
  6667.  
  6668.  
  6669.                                                                         106
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675.             WHILE INKEY$ = ""
  6676.             WEND
  6677.             VIDEOMODESET VMODE
  6678.             END
  6679.  
  6680.  
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.  
  6696.  
  6697.  
  6698.  
  6699.  
  6700.  
  6701.  
  6702.  
  6703.  
  6704.  
  6705.  
  6706.  
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.  
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.                                                                         107
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.           PALDIMSTEP
  6738.  
  6739.             PROTOTYPE
  6740.  
  6741.             SUB PALDIMSTEP (Pal$, FirstColor%, LastColor%, Percent%)
  6742.  
  6743.             INPUT
  6744.  
  6745.             Pal$ - string * 768 containing initial palette
  6746.             FirstColor - index into palette where dim will begin
  6747.             LastColor - index into palette where dim will end
  6748.             Percent - percent step from current palette to black
  6749.  
  6750.             OUTPUT
  6751.  
  6752.             no value returned
  6753.  
  6754.             USAGE
  6755.  
  6756.             PALDIMSTEP fades the specified palette to black by the given
  6757.             percentage between FirstColor and LastColor.  The percentage
  6758.             step from Pal$ to black is specified by Percent where 256 (100
  6759.             hex) is full black.  The valid range for Percent is 0 to 256.
  6760.             Values beyond this range cause the function to immediately
  6761.             return without making any changes.  Pal$ is not modified.
  6762.  
  6763.             SEE ALSO
  6764.  
  6765.             PALCHGAUTO, PALCHGSTEP, PALIOAUTO
  6766.  
  6767.             EXAMPLE
  6768.  
  6769.             REM STEP FADE OUT AND BACK IN FAST
  6770.             REM $INCLUDE: 'SVGABC.BI'
  6771.             DEFINT A-Z
  6772.             DIM PAL AS STRING * 768
  6773.  
  6774.             VMODE = VIDEOMODEGET
  6775.             IF WHICHVGA = 0 THEN STOP
  6776.             IF WHICHMEM < 512 THEN STOP
  6777.             DUMMY=RES640
  6778.             PALGET PAL, 0, 255
  6779.             COLR = 0
  6780.             FOR I = 0 TO 639
  6781.                DRWLINE 1, COLR, I, 0, I, 479
  6782.                COLR = COLR + 1
  6783.                IF COLR > 255 THEN COLR = 0
  6784.             NEXT I
  6785.             FOR I = 255 TO 0 STEP -2
  6786.                PALDIMSTEP PAL, 0, 255, I
  6787.             NEXT I
  6788.             FOR I = 1 TO 255 STEP 16
  6789.                PALDIMSTEP PAL, 0, 255, I
  6790.             NEXT I
  6791.  
  6792.  
  6793.                                                                         108
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.             WHILE INKEY$ = ""
  6800.             WEND
  6801.             VIDEOMODESET VMODE
  6802.             END
  6803.  
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820.  
  6821.  
  6822.  
  6823.  
  6824.  
  6825.  
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831.  
  6832.  
  6833.  
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.  
  6841.  
  6842.  
  6843.  
  6844.  
  6845.  
  6846.  
  6847.  
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.                                                                         109
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.           PALGET
  6862.  
  6863.             PROTOTYPE
  6864.  
  6865.             SUB PALGET (Pal$, FirstColor, LastColor%)
  6866.  
  6867.             INPUT
  6868.  
  6869.             Pal$ - string * 768 to hold current palette
  6870.             FirstColor - index into palette where get will begin
  6871.             LastColor - index into palette where get will end
  6872.  
  6873.             OUTPUT
  6874.  
  6875.             Pal$ - string * 768 containing the current palette in the
  6876.             specified range
  6877.  
  6878.             USAGE
  6879.  
  6880.             PALGET returns in Pal$ the colors from the current palette
  6881.             between FirstColor and LastColor.  Only colors in the
  6882.             specified range are returned and all others in Pal$ are
  6883.             unchanged.  Pal$ must have a length of 768 characters despite
  6884.             the number of colors retrieved.
  6885.  
  6886.             SEE ALSO
  6887.  
  6888.             PALROTATE, PALSET
  6889.  
  6890.             EXAMPLE
  6891.  
  6892.             REM GET THE CURRENT PALETTE IN THE VARIABLE 'PAL'
  6893.             REM $INCLUDE: 'SVGABC.BI'
  6894.             DEFINT A-Z
  6895.             DIM PAL AS STRING * 768
  6896.  
  6897.             VMODE = VIDEOMODEGET
  6898.             IF WHICHVGA = 0 THEN STOP
  6899.             IF WHICHMEM < 512 THEN STOP
  6900.             DUMMY=RES640
  6901.             PALGET PAL, 0, 255
  6902.             VIDEOMODESET VMODE
  6903.             CLS
  6904.             PRINT "GOT IT IN 'PAL'..."
  6905.             WHILE INKEY$ = ""
  6906.             WEND
  6907.             END
  6908.  
  6909.  
  6910.  
  6911.  
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.                                                                         110
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.           PALIOAUTO
  6924.  
  6925.             PROTOTYPE
  6926.  
  6927.             SUB PALIOAUTO (Pal$, FirstColor%, LastColor%, Speed%)
  6928.  
  6929.             INPUT
  6930.  
  6931.             Pal$ - string *768 containing initial palette
  6932.             FirstColor - index into palette where fade will begin
  6933.             LastColor - index into palette where fade will end
  6934.             Speed - speed of fade
  6935.  
  6936.             OUTPUT
  6937.  
  6938.             no value returned
  6939.  
  6940.             USAGE
  6941.  
  6942.             PALIOAUTO smoothly fades the colors between FirstColor and
  6943.             LastColor of Pal$ to or from solid black.  The speed of the
  6944.             fade is set by Speed which is the percentage change between
  6945.             each step of the fade.  A positive Speed corresponds to fading
  6946.             from Pal$ to black and a negative Speed fades from black to
  6947.             Pal$.  Only values between -128 and +128 are valid where  1
  6948.             represents a one percent change between steps and  128 ( 80
  6949.             hex) represents fifty percent change between steps.  A Speed
  6950.             of 128 would then have only two steps.  A Speed outside of the
  6951.             valid range causes the function to immediately return without
  6952.             making any changes.  The time required to accomplish the
  6953.             entire fade is approximately equal to 0.033 seconds times 256
  6954.             divided by Speed.  PALIOAUTO does not modify Pal$.
  6955.  
  6956.             SEE ALSO
  6957.  
  6958.             PALCHGAUTO, PALCHGSTEP, PALDIMSTEP
  6959.  
  6960.             EXAMPLE
  6961.  
  6962.             REM FADE OUT AND BACK IN FAST
  6963.             REM $INCLUDE: 'SVGABC.BI'
  6964.             DEFINT A-Z
  6965.             DIM PAL AS STRING * 768
  6966.             VMODE = VIDEOMODEGET
  6967.             IF WHICHVGA = 0 THEN STOP
  6968.             IF WHICHMEM < 512 THEN STOP
  6969.             DUMMY=RES640
  6970.             PALGET PAL, 0, 255
  6971.             COLR = 0
  6972.             FOR I = 0 TO 639
  6973.                DRWLINE 1, COLR, I, 0, I, 479
  6974.                COLR = COLR + 1
  6975.                IF COLR > 255 THEN COLR = 0
  6976.             NEXT I
  6977.  
  6978.  
  6979.                                                                         111
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.             PALIOAUTO PAL, 0, 255, -2
  6986.             PALIOAUTO PAL, 0, 255, 16
  6987.             WHILE INKEY$ = ""
  6988.             WEND
  6989.             VIDEOMODESET VMODE
  6990.             END
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.  
  7006.  
  7007.  
  7008.  
  7009.  
  7010.  
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.                                                                         112
  7042.  
  7043.  
  7044.  
  7045.  
  7046.  
  7047.           PALROTATE
  7048.  
  7049.             PROTOTYPE
  7050.  
  7051.             SUB PALROTATE (Pal$, FirstColor%, LastColor%, Shift%)
  7052.  
  7053.             INPUT
  7054.  
  7055.             Pal$ - string * 768 containing current palette
  7056.             FirstColor - index into palette where shift will begin
  7057.             LastColor - index into palette where shift will end
  7058.             Shift - number of locations to shift colors
  7059.  
  7060.             OUTPUT
  7061.  
  7062.             no value returned
  7063.  
  7064.             USAGE
  7065.  
  7066.             PALROTATE shifts the colors between FirstColor and LastColor
  7067.             by a given number of locations.  The number of locations the
  7068.             colors are moved is specified by Shift which is between 1 and
  7069.             256.  Pal$ is not modified by PALROTATE.
  7070.  
  7071.             SEE ALSO
  7072.  
  7073.             PALGET, PALSET
  7074.  
  7075.             EXAMPLE
  7076.  
  7077.             REM ROTATE A FEW PALETTE ENTRIES AROUND
  7078.             REM $INCLUDE: 'SVGABC.BI'
  7079.             DEFINT A-Z
  7080.             DIM PAL AS STRING * 768
  7081.  
  7082.             VMODE = VIDEOMODEGET
  7083.             IF WHICHVGA = 0 THEN STOP
  7084.             IF WHICHMEM < 512 THEN STOP
  7085.             DUMMY=RES640
  7086.             PALGET PAL, 0, 255
  7087.             COLR = 0
  7088.             FOR I = 0 TO 639
  7089.                DRWLINE 1, COLR, I, 0, I, 479
  7090.                COLR = COLR + 1
  7091.                IF COLR > 255 THEN COLR = 0
  7092.             NEXT I
  7093.             FOR I = 0 TO 100
  7094.                PALROTATE PAL, 0, 127, 1
  7095.                PALGET PAL, 0, 255
  7096.             NEXT I
  7097.             WHILE INKEY$ = ""
  7098.             WEND
  7099.             VIDEOMODESET VMODE
  7100.             END
  7101.  
  7102.  
  7103.                                                                         113
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.           PALSET
  7110.  
  7111.             PROTOTYPE
  7112.  
  7113.             SUB PALSET (Pal$, FirstColor%, LastColor%)
  7114.  
  7115.             INPUT
  7116.  
  7117.             Pal$ - string * 768 containing the palette to set
  7118.             FirstColor - index into palette where set will begin
  7119.             LastColor - index into palette where set will end
  7120.  
  7121.             OUTPUT
  7122.  
  7123.             no value returned
  7124.  
  7125.             USAGE
  7126.  
  7127.             PALSET sets the specified range of colors in the current
  7128.             palette with the corresponding range in the palette Pal$.
  7129.  
  7130.             SEE ALSO
  7131.  
  7132.             PALGET
  7133.  
  7134.             EXAMPLE
  7135.  
  7136.             REM SET A NEW PALETTE
  7137.             REM $INCLUDE: 'SVGABC.BI'
  7138.             DEFINT A-Z
  7139.             DIM PAL AS STRING * 768
  7140.             DIM NEWPAL AS STRING * 768
  7141.  
  7142.             VMODE = VIDEOMODEGET
  7143.             IF WHICHVGA = 0 THEN STOP
  7144.             IF WHICHMEM < 512 THEN STOP
  7145.             DUMMY=RES640
  7146.             PALGET PAL, 0, 255
  7147.             FOR I = 1 TO 768
  7148.                MID$(NEWPAL, I, 1) = MID$(PAL, 769 - I, 1)
  7149.             NEXT I
  7150.             COLR = 0
  7151.             FOR I = 0 TO 639
  7152.                DRWLINE 1, COLR, I, 0, I, 479
  7153.                COLR = COLR + 1
  7154.                IF COLR > 255 THEN COLR = 0
  7155.             NEXT I
  7156.             PALSET NEWPAL, 0, 255
  7157.             WHILE INKEY$ = ""
  7158.             WEND
  7159.             VIDEOMODESET VMODE
  7160.             END
  7161.  
  7162.  
  7163.  
  7164.  
  7165.                                                                         114
  7166.  
  7167.  
  7168.  
  7169.  
  7170.  
  7171.           RES320
  7172.  
  7173.             PROTOTYPE
  7174.  
  7175.             FUNCTION RES320% ()
  7176.  
  7177.             INPUT
  7178.  
  7179.             no input parameters
  7180.  
  7181.             OUTPUT
  7182.  
  7183.             RES320 always returns a 1.
  7184.  
  7185.             USAGE
  7186.  
  7187.             RES320 sets video mode 0x13 which is the VGA standard 320x200
  7188.             graphics mode with 256 colors.  This function can be called
  7189.             without calling WHICHVGA first as this function requires only
  7190.             that a VGA card is present, not a Super VGA card.  If a VGA is
  7191.             not present, the system may crash.
  7192.  
  7193.             SEE ALSO
  7194.  
  7195.             RES640, RES640L, RES800, RES1024, WHICHVGA
  7196.  
  7197.             EXAMPLE
  7198.  
  7199.             REM SET THE VIDEO MODE TO 320x200x256
  7200.             REM $INCLUDE: 'SVGABC.BI'
  7201.             DEFINT A-Z
  7202.  
  7203.             VMODE = VIDEOMODEGET
  7204.             IF WHICHVGA = 0 THEN STOP
  7205.             DUMMY=RES320
  7206.             DRWSTRING 1, 7, 0, "THIS IS THE 320x200x256 VIDEO MODE...", 0,
  7207.             0
  7208.             WHILE INKEY$ = ""
  7209.             WEND
  7210.             VIDEOMODESET VMODE
  7211.             END
  7212.  
  7213.  
  7214.  
  7215.  
  7216.  
  7217.  
  7218.  
  7219.  
  7220.  
  7221.  
  7222.  
  7223.  
  7224.  
  7225.  
  7226.  
  7227.                                                                         115
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.           RES640
  7234.  
  7235.             PROTOTYPE
  7236.  
  7237.             FUNCTION RES640% ()
  7238.  
  7239.             INPUT
  7240.  
  7241.             no input parameters
  7242.  
  7243.             OUTPUT
  7244.  
  7245.             RES640 returns 1 if successful, 0 otherwise.
  7246.  
  7247.             USAGE
  7248.  
  7249.             RES640 sets the video mode to 640x480 graphics mode with 256
  7250.             colors.  This function requires that a Super VGA card with at
  7251.             least 512K of video memory be present.  Also, WHICHVGA must be
  7252.             called first or the function will fail without changing the
  7253.             video mode.  If the video card does not have sufficient
  7254.             memory, RES640 will return without changing the video mode.
  7255.  
  7256.             SEE ALSO
  7257.  
  7258.             RES320, RES640L, RES800, RES1024, WHICHVGA
  7259.  
  7260.             EXAMPLE
  7261.  
  7262.             REM SET THE VIDEO MODE TO 640x480x256
  7263.             REM $INCLUDE: 'SVGABC.BI'
  7264.             DEFINT A-Z
  7265.  
  7266.             VMODE = VIDEOMODEGET
  7267.             IF WHICHVGA = 0 THEN STOP
  7268.             IF WHICHMEM < 512 THEN STOP
  7269.             DUMMY=RES640
  7270.             DRWSTRING 1, 7, 0, "THIS IS THE 640x480x256 VIDEO MODE...", 0,
  7271.             0
  7272.             WHILE INKEY$ = ""
  7273.             WEND
  7274.             VIDEOMODESET VMODE
  7275.             END
  7276.  
  7277.  
  7278.  
  7279.  
  7280.  
  7281.  
  7282.  
  7283.  
  7284.  
  7285.  
  7286.  
  7287.  
  7288.  
  7289.                                                                         116
  7290.  
  7291.  
  7292.  
  7293.  
  7294.  
  7295.           RES640L
  7296.  
  7297.             PROTOTYPE
  7298.  
  7299.             FUNCTION RES640L% ()
  7300.  
  7301.             INPUT
  7302.  
  7303.             no input parameters
  7304.  
  7305.             OUTPUT
  7306.  
  7307.             RES640L returns 1 if successful, 0 otherwise.
  7308.  
  7309.             USAGE
  7310.  
  7311.             RES640L sets the video mode to 640x400 graphics mode with 256
  7312.             colors.  This function requires that a Super VGA card with at
  7313.             least 256K of video memory be present.  Also, WHICHVGA must be
  7314.             called first or the function will fail without changing the
  7315.             video mode.  If the video card does not have sufficient
  7316.             memory, RES640L will return without changing the video mode.
  7317.  
  7318.             Note: 640x400 is a non-standard resolution.  Not all SVGA
  7319.             cards recognized by this library support this video mode.
  7320.  
  7321.             SEE ALSO
  7322.  
  7323.             RES320, RES640, RES800, RES1024, WHICHVGA
  7324.  
  7325.             EXAMPLE
  7326.  
  7327.             REM SET THE VIDEO MODE TO 640x400x256
  7328.             REM $INCLUDE: 'SVGABC.BI'
  7329.             DEFINT A-Z
  7330.  
  7331.             VMODE = VIDEOMODEGET
  7332.             IF WHICHVGA = 0 THEN STOP
  7333.             IF WHICHMEM < 256 THEN STOP
  7334.             DUMMY=RES640L
  7335.             DRWSTRING 1, 7, 0, "THIS IS THE 640x400x256 VIDEO MODE...", 0,
  7336.             0
  7337.             WHILE INKEY$ = ""
  7338.             WEND
  7339.             VIDEOMODESET VMODE
  7340.             END
  7341.  
  7342.  
  7343.  
  7344.  
  7345.  
  7346.  
  7347.  
  7348.  
  7349.  
  7350.  
  7351.                                                                         117
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.           RES800
  7358.  
  7359.             PROTOTYPE
  7360.  
  7361.             FUNCTION RES800% ()
  7362.  
  7363.             INPUT
  7364.  
  7365.             no input parameters
  7366.  
  7367.             OUTPUT
  7368.  
  7369.             RES800 returns 1 if successful, 0 otherwise.
  7370.  
  7371.             USAGE
  7372.  
  7373.             RES800 sets the video mode to 800x600 graphics mode with 256
  7374.             colors.  This function requires that a Super VGA card with at
  7375.             least 512K of video memory be present.  Also, WHICHVGA must be
  7376.             called first or the function will fail without changing the
  7377.             video mode.  If the video card does not have sufficient
  7378.             memory, RES800 will return without changing the video mode.
  7379.  
  7380.             SEE ALSO
  7381.  
  7382.             RES320, RES640, RES640L, RES1024, WHICHVGA
  7383.  
  7384.             EXAMPLE
  7385.  
  7386.             REM SET THE VIDEO MODE TO 800x600x256
  7387.             REM $INCLUDE: 'SVGABC.BI'
  7388.             DEFINT A-Z
  7389.  
  7390.             VMODE = VIDEOMODEGET
  7391.             IF WHICHVGA = 0 THEN STOP
  7392.             IF WHICHMEM < 512 THEN STOP
  7393.             DUMMY=RES800
  7394.             DRWSTRING 1, 7, 0, "THIS IS THE 800x600x256 VIDEO MODE...", 0,
  7395.             0
  7396.             WHILE INKEY$ = ""
  7397.             WEND
  7398.             VIDEOMODESET VMODE
  7399.             END
  7400.  
  7401.  
  7402.  
  7403.  
  7404.  
  7405.  
  7406.  
  7407.  
  7408.  
  7409.  
  7410.  
  7411.  
  7412.  
  7413.                                                                         118
  7414.  
  7415.  
  7416.  
  7417.  
  7418.  
  7419.           RES1024
  7420.  
  7421.             PROTOTYPE
  7422.  
  7423.             FUNCTION RES1024% ()
  7424.  
  7425.             INPUT
  7426.  
  7427.             no input parameters
  7428.  
  7429.             OUTPUT
  7430.  
  7431.             RES1024 returns 1 if successful, 0 otherwise.
  7432.  
  7433.             USAGE
  7434.  
  7435.             RES1024 sets the video mode to 1024x768 graphics mode with 256
  7436.             colors.  This function requires that a Super VGA card with at
  7437.             least 1 Megabyte of video memory be present.  Also, WHICHVGA
  7438.             must be called first or the function will fail without
  7439.             changing the video mode.  If the video card does not have
  7440.             sufficient memory, RES1024 will return without changing the
  7441.             video mode.
  7442.  
  7443.             SEE ALSO
  7444.  
  7445.             RES320, RES640, RES640L, RES800, WHICHVGA
  7446.  
  7447.             EXAMPLE
  7448.  
  7449.             REM SET THE VIDEO MODE TO 1024x768x256
  7450.             REM $INCLUDE: 'SVGABC.BI'
  7451.             DEFINT A-Z
  7452.  
  7453.             VMODE = VIDEOMODEGET
  7454.             IF WHICHVGA = 0 THEN STOP
  7455.             IF WHICHMEM < 1024 THEN STOP
  7456.             DUMMY=RES1024
  7457.             DRWSTRING 1, 7, 0, "THIS IS THE 1024x768x256 VIDEO MODE...",
  7458.             0, 0
  7459.             WHILE INKEY$ = ""
  7460.             WEND
  7461.             VIDEOMODESET VMODE
  7462.             END
  7463.  
  7464.  
  7465.  
  7466.  
  7467.  
  7468.  
  7469.  
  7470.  
  7471.  
  7472.  
  7473.  
  7474.  
  7475.                                                                         119
  7476.  
  7477.  
  7478.  
  7479.  
  7480.  
  7481.           RESTEXT
  7482.  
  7483.             PROTOTYPE
  7484.  
  7485.             FUNCTION RESTEXT% ()
  7486.  
  7487.             INPUT
  7488.  
  7489.             no input parameters
  7490.  
  7491.             OUTPUT
  7492.  
  7493.             RESTEXT always returns a 1.
  7494.  
  7495.             USAGE
  7496.  
  7497.             RESTEXT sets video mode three which is the VGA standard 80x25
  7498.             text mode.
  7499.  
  7500.             SEE ALSO
  7501.  
  7502.             VIDEOMODEGET, VIDEOMODESET
  7503.  
  7504.             EXAMPLE
  7505.  
  7506.             REM SET THE VIDEO MODE TO STANDARD DOS TEXT MODE 3
  7507.             REM $INCLUDE: 'SVGABC.BI'
  7508.             DEFINT A-Z
  7509.  
  7510.             VMODE = VIDEOMODEGET
  7511.             RESTEXT
  7512.             PRINT "THIS IS THE TEXT VIDEO MODE (DOS VIDEO MODE 3)...
  7513.             WHILE INKEY$ = ""
  7514.             WEND
  7515.             VIDEOMODESET VMODE
  7516.             END
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.  
  7533.  
  7534.  
  7535.  
  7536.  
  7537.                                                                         120
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.           SCROLLDN
  7544.  
  7545.             PROTOTYPE
  7546.  
  7547.             SUB SCROLLDN (X1%, Y1%, X2%, Y2%, Num%, Color%)
  7548.  
  7549.             INPUT
  7550.  
  7551.             X1, Y1 - top left corner of block
  7552.             X2, Y2 - bottom right corner of block
  7553.             Num - number of pixels to shift
  7554.             Color - index to color in current palette
  7555.  
  7556.             OUTPUT
  7557.  
  7558.             no value returned
  7559.  
  7560.             USAGE
  7561.  
  7562.             SCROLLDN shifts the contents of the box described by (X1, Y1)
  7563.             - (X2, Y2) down by the number of pixels specified by Num.  The
  7564.             empty pixels created at the top of the box are filled with
  7565.             Color.  The pixels that are shifted out of the box are lost.
  7566.             SCROLLDN enforces X2 X1 and Y2Y1.  When placed within a loop,
  7567.             SCROLLDN will create a scrolling effect.
  7568.  
  7569.             SEE ALSO
  7570.  
  7571.             SCROLLLT, SCROLLRT, SCROLLUP
  7572.  
  7573.             EXAMPLE
  7574.  
  7575.             REM SCROLL SOME TEXT DOWN
  7576.             REM $INCLUDE: 'SVGABC.BI'
  7577.             DEFINT A-Z
  7578.  
  7579.             VMODE = VIDEOMODEGET
  7580.             IF WHICHVGA = 0 THEN STOP
  7581.             IF WHICHMEM < 512 THEN STOP
  7582.             DUMMY=RES640
  7583.             DRWBOX 1, 10, 0, 0, 100, 100
  7584.             DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
  7585.             FOR I = 0 TO 40
  7586.                SCROLLDN 1, 1, 99, 99, 1, 0
  7587.                SDELAY 2
  7588.             NEXT I
  7589.             WHILE INKEY$ = ""
  7590.             WEND
  7591.             VIDEOMODESET VMODE
  7592.             END
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.                                                                         121
  7600.  
  7601.  
  7602.  
  7603.  
  7604.  
  7605.           SCROLLLT
  7606.  
  7607.             PROTOTYPE
  7608.  
  7609.             SUB SCROLLLT (X1%, Y1%, X2%, Y2%, Num%, Color%)
  7610.  
  7611.             INPUT
  7612.  
  7613.             X1, Y1 - top left corner of block
  7614.             X2, Y2 - bottom right corner of block
  7615.             Num - number of pixels to shift
  7616.             Color - index to color in current palette
  7617.  
  7618.             OUTPUT
  7619.  
  7620.             no value returned
  7621.  
  7622.             USAGE
  7623.  
  7624.             SCROLLLT shifts the contents of the box described by (X1, Y1)
  7625.             - (X2, Y2) down by the number of pixels specified by Num.  The
  7626.             empty pixels created at the right of the box are filled with
  7627.             Color.  The pixels that are shifted out of the box are lost.
  7628.             SCROLLLT enforces X2 X1 and Y2Y1.  When placed within a loop,
  7629.             SCROLLRT will create a scrolling effect.
  7630.  
  7631.             SEE ALSO
  7632.  
  7633.             SCROLLDN, SCROLLRT, SCROLLUP
  7634.  
  7635.             EXAMPLE
  7636.  
  7637.             REM SCROLL SOME TEXT LEFT
  7638.             REM $INCLUDE: 'SVGABC.BI'
  7639.             DEFINT A-Z
  7640.  
  7641.             VMODE = VIDEOMODEGET
  7642.             IF WHICHVGA = 0 THEN STOP
  7643.             IF WHICHMEM < 512 THEN STOP
  7644.             DUMMY=RES640
  7645.             DRWBOX 1, 10, 0, 0, 100, 100
  7646.             DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
  7647.             FOR I = 0 TO 40
  7648.                SCROLLLT 1, 1, 99, 99, 1, 0
  7649.                SDELAY 2
  7650.             NEXT I
  7651.             WHILE INKEY$ = ""
  7652.             WEND
  7653.             VIDEOMODESET VMODE
  7654.             END
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.                                                                         122
  7662.  
  7663.  
  7664.  
  7665.  
  7666.  
  7667.           SCROLLRT
  7668.  
  7669.             PROTOTYPE
  7670.  
  7671.             SUB SCROLLRT (X1%, Y1%, X2%, Y2%, Num%, Color%)
  7672.  
  7673.             INPUT
  7674.  
  7675.             X1, Y1 - top left corner of block
  7676.             X2, Y2 - bottom right corner of block
  7677.             Num - number of pixels to shift
  7678.             Color - index to color in current palette
  7679.  
  7680.             OUTPUT
  7681.  
  7682.             no value returned
  7683.  
  7684.             USAGE
  7685.  
  7686.             SCROLLRT shifts the contents of the box described by (X1, Y1)
  7687.             - (X2, Y2) down by the number of pixels specified by Num.  The
  7688.             empty pixels created at the left of the box are filled with
  7689.             Color.  The pixels that are shifted out of the box are lost.
  7690.             SCROLLRT enforces X2 X1 and Y2Y1.  When placed within a loop,
  7691.             SCROLLRT will create a scrolling effect.
  7692.  
  7693.             SEE ALSO
  7694.  
  7695.             SCROLLDN, SCROLLLT, SCROLLUP
  7696.  
  7697.             EXAMPLE
  7698.  
  7699.             REM SCROLL SOME TEXT RIGHT
  7700.             REM $INCLUDE: 'SVGABC.BI'
  7701.             DEFINT A-Z
  7702.  
  7703.             VMODE = VIDEOMODEGET
  7704.             IF WHICHVGA = 0 THEN STOP
  7705.             IF WHICHMEM < 512 THEN STOP
  7706.             DUMMY=RES640
  7707.             DRWBOX 1, 10, 0, 0, 100, 100
  7708.             DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
  7709.             FOR I = 0 TO 40
  7710.                SCROLLRT 1, 1, 99, 99, 1, 0
  7711.                SDELAY 2
  7712.             NEXT I
  7713.             WHILE INKEY$ = ""
  7714.             WEND
  7715.             VIDEOMODESET VMODE
  7716.             END
  7717.  
  7718.  
  7719.  
  7720.  
  7721.  
  7722.  
  7723.                                                                         123
  7724.  
  7725.  
  7726.  
  7727.  
  7728.  
  7729.           SCROLLUP
  7730.  
  7731.             PROTOTYPE
  7732.  
  7733.             SUB SCROLLUP (X1%, Y1%, X2%, Y2%, Num%, Color%)
  7734.  
  7735.             INPUT
  7736.  
  7737.             X1, Y1 - top left corner of block
  7738.             X2, Y2 - bottom right corner of block
  7739.             Num - number of pixels to shift
  7740.             Color - index to color in current palette
  7741.  
  7742.             OUTPUT
  7743.  
  7744.             no value returned
  7745.  
  7746.             USAGE
  7747.  
  7748.             SCROLLUP shifts the contents of the box described by (X1, Y1)
  7749.             - (X2, Y2) down by the number of pixels specified by Num.  The
  7750.             empty pixels created at the bottom of the box are filled with
  7751.             Color.  The pixels that are shifted out of the box are lost.
  7752.             SCROLLUP enforces X2 X1 and Y2Y1.  When placed within a loop,
  7753.             SCROLLUP will create a scrolling effect.
  7754.  
  7755.             SEE ALSO
  7756.  
  7757.             SCROLLDN, SCROLLLT, SCROLLRT
  7758.  
  7759.             EXAMPLE
  7760.  
  7761.             REM SCROLL SOME TEXT UP
  7762.             REM $INCLUDE: 'SVGABC.BI'
  7763.             DEFINT A-Z
  7764.  
  7765.             VMODE = VIDEOMODEGET
  7766.             IF WHICHVGA = 0 THEN STOP
  7767.             IF WHICHMEM < 512 THEN STOP
  7768.             DUMMY=RES640
  7769.             DRWBOX 1, 10, 0, 0, 100, 100
  7770.             DRWSTRING 1, 7, 0, "TEXT TEXT", 20, 43
  7771.             FOR I = 0 TO 40
  7772.                SCROLLUP 1, 1, 99, 99, 1, 0
  7773.                SDELAY 2
  7774.             NEXT I
  7775.             WHILE INKEY$ = ""
  7776.             WEND
  7777.             VIDEOMODESET VMODE
  7778.             END
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784.  
  7785.                                                                         124
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.           SDELAY
  7792.  
  7793.             PROTOTYPE
  7794.  
  7795.             SUB SDELAY (Count%)
  7796.  
  7797.             INPUT
  7798.  
  7799.             Count - number of vertical syncs to wait
  7800.  
  7801.             OUTPUT
  7802.  
  7803.             no value returned
  7804.  
  7805.             USAGE
  7806.  
  7807.             SDELAY pauses execution of the program for a period of time
  7808.             specified by Count.  This delay remains approximately constant
  7809.             on all machines by using the vertical sync timer of the VGA
  7810.             graphics card which is about 60 - 70 Hz.
  7811.  
  7812.             EXAMPLE
  7813.  
  7814.             REM MAKE A DELAY ABOUT 3 SECONDS LONG
  7815.             REM $INCLUDE: 'SVGABC.BI'
  7816.             DEFINT A-Z
  7817.  
  7818.             CLS
  7819.             PRINT "OK...STARTING DELAY NOW..."
  7820.             PRINT "SHOULD BE ABOUT 3 SECONDS..."
  7821.             PRINT
  7822.             TIM! = TIMER
  7823.             SDELAY 195
  7824.             TOT! = TIMER - TIM!
  7825.             PRINT "ACTUAL TIME WAS:"; TOT!
  7826.             WHILE INKEY$ = ""
  7827.             WEND
  7828.             END
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.  
  7845.  
  7846.  
  7847.                                                                         125
  7848.  
  7849.  
  7850.  
  7851.  
  7852.  
  7853.           SETCARD
  7854.  
  7855.             PROTOTYPE
  7856.  
  7857.             SUB SETCARD (Chip%, Mem%)
  7858.  
  7859.             INPUT
  7860.  
  7861.             Chip - code for certain SVGA chip type
  7862.             Mem - amount of video memory installed
  7863.  
  7864.             OUTPUT
  7865.  
  7866.             no value returned
  7867.  
  7868.             USAGE
  7869.  
  7870.             WARNING:  USING SETCARD IMPROPERLY MAY CAUSE A SYSTEM FAILURE
  7871.             OR DAMAGE.
  7872.             SETCARD sets the card type and installed video memory.  It can
  7873.             be used instead of the WHICHVGA function.  However, specifying
  7874.             an incorrect chip type or installed video memory may cause
  7875.             unpredictable results not excluding damage to the SVGA card
  7876.             and/or monitor.  Extreme caution is advised when using this
  7877.             function.  It is recommended that this function only be used
  7878.             when it is suspected that the identification process in
  7879.             WHICHVGA failed.  Be absolutely certain that the chip type
  7880.             specified is the actual chip type installed in the computer.
  7881.             Mem should be a value of 256, 512 or 1024 representing the
  7882.             kilobytes of video memory installed.  Use the following table
  7883.             to identify chip types:
  7884.  
  7885.           1  Acumos AVGA2/3 SuperVGA
  7886.           2  ATI Technologies 18/28/38/68800 SuperVGA
  7887.           3  Ahead V5000 ver A SuperVGA
  7888.           4  Ahead V5000 ver B SuperVGA
  7889.           5  Chips and Technologies 82C45x SuperVGA
  7890.           6  Cirrus Logic CL-GD 5xx, 6xx, 28xx, 54xx, 62xx SuperVGA
  7891.           7  Everex Micro Enhancer Ev236/6xx SuperVGA
  7892.           8  Genoa 61/62/63/64/6600 SuperVGA
  7893.           9  NCR 77C21/22/22E/22E+ SuperVGA
  7894.           10 Oak Technologies OTI-037C/067/077/087 SuperVGA
  7895.           11 Paradise/Western Digital PVGA1A, WD90C00/1x/2x/3x SuperVGA
  7896.           12 Realtek RT3106 SuperVGA
  7897.           13 Trident 8800CS, 8900B/C/CL/CX, 90x0 SuperVGA
  7898.           14 Tseng Labs ET3000-AX/BX/BP SuperVGA
  7899.           15 Tseng Labs ET4000/W32/W32I SuperVGA
  7900.           16 VESA compatible SuperVGA
  7901.           17 Video 7 HT-208/16 SuperVGA
  7902.           18 Avance Logic AL2101 SuperVGA
  7903.           19 MXIC MX68000/10 SuperVGA
  7904.           20 Primus P2000 SuperVGA
  7905.  
  7906.             SEE ALSO
  7907.  
  7908.  
  7909.                                                                         126
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.             WHICHVGA
  7917.  
  7918.             EXAMPLE
  7919.  
  7920.             REM
  7921.             !WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNI
  7922.             NG!
  7923.  
  7924.             REM USE THIS FUNCTION CAREFULLY. IT WORKS AROUND THE "WHICHVGA
  7925.             FUNCTION"
  7926.             REM IMPROPER USE (I.E. SETTING THE CARD ID AND MEMORY TO
  7927.             SOMETHING THAT
  7928.             REM THAT IS NOT VALID) MIGHT DAMAGE YOUR VIDEO CARD/VIDEO
  7929.             MONITOR OR
  7930.             REM CAUSE UNPREDICTABLE RESULTS. IT IS PROVIDED AS A METHOD TO
  7931.             FIND
  7932.             REM FAULTS IN THE VIDEO CARD/CHIP ID PROCESS.
  7933.  
  7934.             REM
  7935.             !WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNI
  7936.             NG!
  7937.  
  7938.             END
  7939.  
  7940.  
  7941.  
  7942.  
  7943.  
  7944.  
  7945.  
  7946.  
  7947.  
  7948.  
  7949.  
  7950.  
  7951.  
  7952.  
  7953.  
  7954.  
  7955.  
  7956.  
  7957.  
  7958.  
  7959.  
  7960.  
  7961.  
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.                                                                         127
  7972.  
  7973.  
  7974.  
  7975.  
  7976.  
  7977.           SETVIEW
  7978.  
  7979.             PROTOTYPE
  7980.  
  7981.             SUB SETVIEW (X1%, Y1%, X2%, Y2%)
  7982.  
  7983.             INPUT
  7984.  
  7985.             X1, Y1 - top, left corner of view port
  7986.             X2, Y2 - bottom, right corner of view port
  7987.  
  7988.             OUTPUT
  7989.  
  7990.             no value returned
  7991.  
  7992.             USAGE
  7993.  
  7994.             SETVIEW defines a viewport for clipping output on the screen.
  7995.             Nothing can be drawn outside of the currently defined
  7996.             viewport.  The RES### functions set the viewport to the full
  7997.             screen.  The restrictions on X1, Y1, X2 and Y2 are as follows:
  7998.  
  7999.             0   X1 < X2  (screen width)
  8000.             0   Y1 < Y2  (32767, effectively unbounded)
  8001.  
  8002.             SEE ALSO
  8003.  
  8004.             RES320, RES640, RES640L, RES800, RES1024
  8005.  
  8006.             EXAMPLE
  8007.  
  8008.             REM DRAW SOME LINES CLIPPED TO A VIEWPORT
  8009.             REM $INCLUDE: 'SVGABC.BI'
  8010.             DEFINT A-Z
  8011.  
  8012.             VMODE = VIDEOMODEGET
  8013.             IF WHICHVGA = 0 THEN STOP
  8014.             IF WHICHMEM < 512 THEN STOP
  8015.             DUMMY=RES640
  8016.             DRWBOX 1, 15, 100, 100, 539, 379
  8017.             SETVIEW 101, 101, 538, 378
  8018.             FOR I = 0 TO 300
  8019.                X1 = RND * 640
  8020.                Y1 = RND * 480
  8021.                X2 = RND * 640
  8022.                Y2 = RND * 480
  8023.                DRWLINE 1, 10, X1, Y1, X2, Y2
  8024.             NEXT I
  8025.             WHILE INKEY$ = ""
  8026.             WEND
  8027.             VIDEOMODESET VMODE
  8028.             END
  8029.  
  8030.  
  8031.  
  8032.  
  8033.                                                                         128
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.           SPRITECOLLDETECT
  8040.  
  8041.             PROTOTYPE
  8042.  
  8043.             FUNCTION SPRITECOLLDETECT% (TransColor%, X1%, Y1%, X2%, Y2%,
  8044.             GfxBlk1%, GfxBlk2%)
  8045.  
  8046.             INPUT
  8047.  
  8048.             TransColor - index to color in current palette
  8049.             X1, Y1 - top, left corner of sprite number 1
  8050.             X2, Y2 - top, left corner of sprite number 2
  8051.             GfxBlk1 - predefined integer array containing the sprite
  8052.             number 1
  8053.             GfxBlk2 - predefined integer array containing the sprite
  8054.             number 2
  8055.  
  8056.             OUTPUT
  8057.  
  8058.             SPRITECOLLDETECT returns the collision status of the two
  8059.             sprites.
  8060.  
  8061.             USAGE
  8062.  
  8063.             SPRITECOLLDETECT is used in sprite graphics or animation to
  8064.             report the collision status between two sprites.  GfxBlk1, a
  8065.             short integer array, contains the first sprite which should
  8066.             have been previously defined by BLKGET or similar function.
  8067.             GfxBlk2, likewise, contains the second sprite.  The top, left
  8068.             corner of the first and second sprites' locations are
  8069.             specified by X1, Y1 and X2, Y2, respectively.
  8070.  
  8071.             SPRITECOLLDETECT will return a zero if the sprites are not
  8072.             colliding and the blocks are not overlapping.  The return will
  8073.             be one if the blocks overlap, but the sprites are not
  8074.             colliding.  A return value of two indicates that the sprites
  8075.             have at least one overlapping pixel and are, therefore,
  8076.             colliding.
  8077.  
  8078.             Arrays should be passed by giving the element within the array
  8079.             from where the action should take place.  This allows the
  8080.             programmer to store more than one item within the same array
  8081.             or act on only a portion of the array.
  8082.  
  8083.             SEE ALSO
  8084.  
  8085.             BLKGET, BLKPUT, GETLASTSTRING, SPRITEGAP, SPRITEGET, SPRITEPUT
  8086.  
  8087.             EXAMPLE
  8088.  
  8089.             REM SHOW THE RESULTS OF THE SPRITE COLLISION DETECTION
  8090.             FUNCTION
  8091.             REM $INCLUDE: 'SVGABC.BI'
  8092.  
  8093.  
  8094.  
  8095.                                                                         129
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.             DEFINT A-Z
  8102.  
  8103.             DIM D1(0 TO 4000) AS INTEGER
  8104.             DIM D2(0 TO 4000) AS INTEGER
  8105.  
  8106.             IF WHICHVGA < 0 THEN STOP
  8107.             ORGMODE = VIDEOMODEGET
  8108.             DUMMY=RES320
  8109.             X1 = 0
  8110.             Y1 = 0
  8111.             X2 = 24
  8112.             Y2 = 24
  8113.             DRWLINE 1, 8, X1, Y1, X2, Y1
  8114.             DRWLINE 1, 8, X2, Y1, X2, Y2
  8115.             DRWLINE 1, 8, X2, Y2, X1, Y2
  8116.             DRWLINE 1, 8, X1, Y2, X1, Y1
  8117.             FILLAREA X1 + 1, Y1 + 1, 8, 8
  8118.             DRWLINE 1, 10, X1, Y1, X2, Y2
  8119.             DRWLINE 1, 10, X2, Y1, X1, Y2
  8120.             BLKGET X1, Y1, X2, Y2, D1(0)
  8121.             BLKPUT 2, X1, Y1, D1(0)
  8122.             X1 = 0
  8123.             Y1 = 0
  8124.             X2 = 48
  8125.             Y2 = 48
  8126.             DRWLINE 1, 8, X1, Y1, X2, Y1
  8127.             DRWLINE 1, 8, X2, Y1, X2, Y2
  8128.             DRWLINE 1, 8, X2, Y2, X1, Y2
  8129.             DRWLINE 1, 8, X1, Y2, X1, Y1
  8130.             FILLAREA X1 + 1, Y1 + 1, 8, 8
  8131.             DRWCIRCLE 1, 10, X1 + 24, Y1 + 24, 24
  8132.             BLKGET X1, Y1, X2, Y2, D2(0)
  8133.             BLKPUT 2, X1, Y1, D2(0)
  8134.             X1 = 90
  8135.             Y1 = 90
  8136.             BLKPUT 2, X1, Y1, D2(0)
  8137.             FOR X = 50 TO 150
  8138.                BLKPUT 2, X, X, D1(0)
  8139.                A = SPRITECOLLDETECT(8, X, X, X1, Y1, D1(0), D2(0))
  8140.                A$ = STR$(A)
  8141.                IF LEN(A$) < 5 THEN A$ = A$ + " "
  8142.                DRWSTRING 1, 7, 0, A$, 0, 0
  8143.                WHILE INKEY$ = ""
  8144.                WEND
  8145.                BLKPUT 2, X, X, D1(0)
  8146.             NEXT X
  8147.             VIDEOMODESET ORGMODE
  8148.             END
  8149.  
  8150.  
  8151.  
  8152.  
  8153.  
  8154.  
  8155.  
  8156.  
  8157.                                                                         130
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.           SPRITEGAP
  8164.  
  8165.             PROTOTYPE
  8166.  
  8167.             SUB SPRITEGAP (TransColor%, X%, Y%, GfxBlk%, BkGndGfxBlk%)
  8168.  
  8169.             INPUT
  8170.  
  8171.             TransColor - index to color in current palette
  8172.             X, Y - top, left corner of block
  8173.             GfxBlk - predefined integer array containing the sprite
  8174.  
  8175.             OUTPUT
  8176.  
  8177.             no value returned
  8178.             BkGndGfxBlk - integer array holding the sprite background
  8179.  
  8180.             USAGE
  8181.  
  8182.             SPRITEGAP ("Sprite-Get-And-Put") is used in sprite graphics or
  8183.             animation to retrieve a sprite's background and then display
  8184.             the sprite.  GfxBlk, a short integer array, contains the
  8185.             sprite which should have been previously defined by BLKGET or
  8186.             similar function such as GETLASTSTRING.  TransColor is the
  8187.             transparent color assumed in GfxBlk.  BkGndGfxBlk, an empty
  8188.             short integer array the same size as GfxBlk, will receive the
  8189.             sprite's background.  The top, left corner of the sprite's
  8190.             location is specified by X, Y.
  8191.  
  8192.             Arrays should be passed by giving the element within the array
  8193.             from where the action should take place.  This allows the
  8194.             programmer to store more than one item within the same array
  8195.             or act on only a portion of the array.
  8196.  
  8197.             SEE ALSO
  8198.  
  8199.             BLKGET, BLKPUT, GETLASTSTRING, SPRITECOLLDETECT, SPRITEGET,
  8200.             SPRITEPUT
  8201.  
  8202.             EXAMPLE
  8203.  
  8204.             REM SHOW SPRITEGAP
  8205.             REM $INCLUDE: 'SVGABC.BI'
  8206.             DEFINT A-Z
  8207.             DIM GFXBLK1(10000)
  8208.             DIM GFXBLK2(10000)
  8209.             DIM GFXBLK3(10000)
  8210.  
  8211.             IF WHICHVGA = 0 THEN STOP
  8212.             VMODE = VIDEOMODEGET
  8213.             IF RES640 <> 1 THEN
  8214.                VIDEOMODESET VMODE
  8215.                END
  8216.             END IF
  8217.  
  8218.  
  8219.                                                                         131
  8220.  
  8221.  
  8222.  
  8223.  
  8224.  
  8225.             Colr = 1
  8226.             FOR I = 0 TO GETMAXX \ 2
  8227.                DRWCIRCLE 1, Colr, GETMAXX \ 4 + I, GETMAXY \ 2, GETMAXY \ 5
  8228.                Colr = Colr + 1
  8229.                IF Colr > 15 THEN
  8230.                  Colr = 1
  8231.                END IF
  8232.             NEXT I
  8233.             XINC = GETMAXX \ 20
  8234.             YINC = GETMAXY \ 20
  8235.             X1 = GETMAXX \ 2 - XINC
  8236.             Y1 = GETMAXY \ 2 - YINC
  8237.             X2 = GETMAXX \ 2 + XINC
  8238.             Y2 = GETMAXY \ 2 + YINC
  8239.             X = (X2 - X1) \ 2 + X1
  8240.             Y = (Y2 - Y1) \ 2 + Y1
  8241.             BLKGET X1, Y1, X2, Y2, GFXBLK1(0)
  8242.             DRWBOX 1, 0, X1, Y1, X2, Y2
  8243.             FILLAREA X1 + 2, Y1 + 2, 0, 0
  8244.             BLKGET X1, Y1, X2, Y2, GFXBLK3(0)
  8245.             FOR I = 0 TO 360 STEP 3
  8246.                DUMMY = BLKROTATE(I, 1, GFXBLK1(0), GFXBLK2(0))
  8247.                SPRITEPUT 1, 1, X - GFXBLK3(0) \ 2, Y - GFXBLK3(1) \ 2,
  8248.             GFXBLK3(0)
  8249.                SPRITEGAP 1, X - GFXBLK2(0) \ 2, Y - GFXBLK2(1) \ 2,
  8250.             GFXBLK2(0), GFXBLK3(0)
  8251.                SDELAY 3
  8252.             NEXT I
  8253.             SPRITEPUT 1, 1, X - GFXBLK3(0) \ 2, Y - GFXBLK3(1) \ 2,
  8254.             GFXBLK3(0)
  8255.             BLKPUT 1, X1, Y1, GFXBLK1(0)
  8256.             VIDEOMODESET VMODE
  8257.             END
  8258.  
  8259.  
  8260.  
  8261.  
  8262.  
  8263.  
  8264.  
  8265.  
  8266.  
  8267.  
  8268.  
  8269.  
  8270.  
  8271.  
  8272.  
  8273.  
  8274.  
  8275.  
  8276.  
  8277.  
  8278.  
  8279.  
  8280.  
  8281.                                                                         132
  8282.  
  8283.  
  8284.  
  8285.  
  8286.  
  8287.           SPRITEGET
  8288.  
  8289.             PROTOTYPE
  8290.  
  8291.             SUB SPRITEGET (TransColor%, X%, Y%, GfxBlk%, BkGndGfxBlk%)
  8292.  
  8293.             INPUT
  8294.  
  8295.             TransColor - index to color in current palette
  8296.             X, Y - top, left corner of block
  8297.             GfxBlk - predefined integer array containing the sprite
  8298.  
  8299.             OUTPUT
  8300.  
  8301.             no value returned
  8302.             BkGndGfxBlk - integer array holding the sprite background
  8303.  
  8304.             USAGE
  8305.  
  8306.             SPRITEGET is used in sprite graphics or animation to retrieve
  8307.             the background for a sprite, normally just before using
  8308.             SPRITEPUT.  GfxBlk, a short integer array, contains the sprite
  8309.             which should have been previously defined by BLKGET or similar
  8310.             function.  TransColor is the transparent color assumed in
  8311.             GfxBlk.  BkGndGfxBlk, an empty short integer array of the same
  8312.             size as GfxBlk, will receive the sprite's background.  The
  8313.             top, left corner of the sprite's location is specified by X,
  8314.             Y.
  8315.  
  8316.             Arrays should be passed by giving the element within the array
  8317.             from where the action should take place.  This allows the
  8318.             programmer to store more than one item within the same array
  8319.             or act on only a portion of the array.
  8320.  
  8321.             SEE ALSO
  8322.  
  8323.             BLKGET, BLKPUT, GETLASTSTRING, SPRITECOLLDETECT, SPRITEGAP,
  8324.             SPRITEPUT
  8325.  
  8326.             EXAMPLE
  8327.  
  8328.             REM SHOW SPRITEGET
  8329.             REM $INCLUDE: 'SVGABC.BI'
  8330.             DEFINT A-Z
  8331.             DIM GFXBLK1(10000)
  8332.             DIM GFXBLK2(10000)
  8333.             DIM GFXBLK3(10000)
  8334.  
  8335.             IF WHICHVGA = 0 THEN STOP
  8336.             VMODE = VIDEOMODEGET
  8337.             IF RES640 <> 1 THEN
  8338.                VIDEOMODESET VMODE
  8339.                END
  8340.             END IF
  8341.  
  8342.  
  8343.                                                                         133
  8344.  
  8345.  
  8346.  
  8347.  
  8348.  
  8349.             Colr = 1
  8350.             FOR I = 0 TO GETMAXX \ 2
  8351.                DRWCIRCLE 1, Colr, GETMAXX \ 4 + I, GETMAXY \ 2, GETMAXY \ 5
  8352.                Colr = Colr + 1
  8353.                IF Colr > 15 THEN
  8354.                  Colr = 1
  8355.                END IF
  8356.             NEXT I
  8357.             XINC = GETMAXX \ 20
  8358.             YINC = GETMAXY \ 20
  8359.             X1 = GETMAXX \ 2 - XINC
  8360.             Y1 = GETMAXY \ 2 - YINC
  8361.             X2 = GETMAXX \ 2 + XINC
  8362.             Y2 = GETMAXY \ 2 + YINC
  8363.             X = (X2 - X1) \ 2 + X1
  8364.             Y = (Y2 - Y1) \ 2 + Y1
  8365.             BLKGET X1, Y1, X2, Y2, GFXBLK1(0)
  8366.             DRWBOX 1, 0, X1, Y1, X2, Y2
  8367.             FILLAREA X1 + 2, Y1 + 2, 0, 0
  8368.             BLKGET X1, Y1, X2, Y2, GFXBLK3(0)
  8369.             FOR I = 0 TO 360 STEP 3
  8370.                DUMMY = BLKROTATE(I, 1, GFXBLK1(0), GFXBLK2(0))
  8371.                SPRITEPUT 1, 1, X - GFXBLK3(0) \ 2, Y - GFXBLK3(1) \ 2,
  8372.             GFXBLK3(0)
  8373.                SPRITEGET 1, X - GFXBLK2(0) \ 2, Y - GFXBLK2(1) \ 2,
  8374.             GFXBLK2(0), GFXBLK3(0)
  8375.                SPRITEPUT 1, 1, X - GFXBLK2(0) \ 2, Y - GFXBLK2(1) \ 2,
  8376.             GFXBLK2(0)
  8377.                SDELAY 3
  8378.             NEXT I
  8379.             SPRITEPUT 1, 1, X - GFXBLK3(0) \ 2, Y - GFXBLK3(1) \ 2,
  8380.             GFXBLK3(0)
  8381.             BLKPUT 1, X1, Y1, GFXBLK1(0)
  8382.             VIDEOMODESET VMODE
  8383.             END
  8384.  
  8385.  
  8386.  
  8387.  
  8388.  
  8389.  
  8390.  
  8391.  
  8392.  
  8393.  
  8394.  
  8395.  
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.  
  8404.  
  8405.                                                                         134
  8406.  
  8407.  
  8408.  
  8409.  
  8410.  
  8411.           SPRITEPUT
  8412.  
  8413.             PROTOTYPE
  8414.  
  8415.             SUB SPRITEPUT (Mode%, TransColor%, X%, Y%, GfxBlk%)
  8416.  
  8417.             INPUT
  8418.  
  8419.             Mode - pixel write mode (SET=1, XOR=2, OR=3, AND=4)
  8420.             TransColor - index to color in current palette
  8421.             X, Y - top, left corner of block
  8422.             GfxBlk - predefined integer array containing the sprite
  8423.  
  8424.             OUTPUT
  8425.  
  8426.             no value returned
  8427.  
  8428.             USAGE
  8429.  
  8430.             SPRITEPUT is used in sprite graphics or animation to display a
  8431.             sprite or, more commonly, its background.  GfxBlk, a short
  8432.             integer array, contains the sprite which should have been
  8433.             previously defined by BLKGET,  SPRITEGAP or SPRITEGET.
  8434.             TransColor is the transparent color assumed in GfxBlk.  The
  8435.             top, left corner of the sprite's location is specified by X,
  8436.             Y.
  8437.  
  8438.             Arrays should be passed by giving the element within the array
  8439.             from where the action should take place.  This allows the
  8440.             programmer to store more than one item within the same array
  8441.             or act on only a portion of the array.
  8442.  
  8443.             SEE ALSO
  8444.  
  8445.             BLKGET, BLKPUT, GETLASTSTRING, SPRITECOLLDETECT, SPRITEGAP,
  8446.             SPRITEGET
  8447.  
  8448.             EXAMPLE
  8449.  
  8450.             See SPRITEGAP
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456.  
  8457.  
  8458.  
  8459.  
  8460.  
  8461.  
  8462.  
  8463.  
  8464.  
  8465.  
  8466.  
  8467.                                                                         135
  8468.  
  8469.  
  8470.  
  8471.  
  8472.  
  8473.           VIDEOMODEGET
  8474.  
  8475.             PROTOTYPE
  8476.  
  8477.             FUNCTION VIDEOMODEGET% ()
  8478.  
  8479.             INPUT
  8480.  
  8481.             no input parameters
  8482.  
  8483.             OUTPUT
  8484.  
  8485.             VIDEOMODEGET returns the current video mode.
  8486.  
  8487.             USAGE
  8488.  
  8489.             VIDEOMODEGET returns the current video mode.  This function is
  8490.             best used to retrieve the video mode being used when a program
  8491.             begins.  When the program ends, this video mode can then be
  8492.             restored using VIDEOMODESET.
  8493.  
  8494.             SEE ALSO
  8495.  
  8496.             RES320, RES640, RES640L, RES800, RES1024, RESTEXT,
  8497.             VIDEOMODESET
  8498.  
  8499.             EXAMPLE
  8500.  
  8501.             REM SAVE THE VIDEO MODE,SWITCH TO 640X480X256, RESTORE THE
  8502.             ORIGINAL MODE
  8503.             REM $INCLUDE: 'SVGABC.BI'
  8504.             DEFINT A-Z
  8505.  
  8506.             VMODE = VIDEOMODEGET
  8507.             IF WHICHVGA = 0 THEN STOP
  8508.             IF WHICHMEM < 512 THEN STOP
  8509.             DUMMY=RES640
  8510.             DRWSTRING 1, 7, 0, "PRESS A KEY...", 0, 0
  8511.             WHILE INKEY$ = ""
  8512.             WEND
  8513.             VIDEOMODESET VMODE
  8514.             END
  8515.  
  8516.  
  8517.  
  8518.  
  8519.  
  8520.  
  8521.  
  8522.  
  8523.  
  8524.  
  8525.  
  8526.  
  8527.  
  8528.  
  8529.                                                                         136
  8530.  
  8531.  
  8532.  
  8533.  
  8534.  
  8535.           VIDEOMODESET
  8536.  
  8537.             PROTOTYPE
  8538.  
  8539.             SUB VIDEOMODESET (Mode%)
  8540.  
  8541.             INPUT
  8542.  
  8543.             Mode - number of video mode
  8544.  
  8545.             OUTPUT
  8546.  
  8547.             no value returned
  8548.  
  8549.             USAGE
  8550.  
  8551.             VIDEOMODESET sets the video mode specified by Mode.  This
  8552.             function is best used at the end of a program to restore the
  8553.             video mode to the mode in use when the program began.  The
  8554.             program should retrieve the video mode at the beginning by
  8555.             using VIDEOMODEGET.
  8556.  
  8557.             SEE ALSO
  8558.  
  8559.             RES320, RES640, RES640L, RES800, RES1024, RESTEXT,
  8560.             VIDEOMODEGET
  8561.  
  8562.             EXAMPLE
  8563.  
  8564.             See VIDEOMODEGET
  8565.  
  8566.  
  8567.  
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.  
  8574.  
  8575.  
  8576.  
  8577.  
  8578.  
  8579.  
  8580.  
  8581.  
  8582.  
  8583.  
  8584.  
  8585.  
  8586.  
  8587.  
  8588.  
  8589.  
  8590.  
  8591.                                                                         137
  8592.  
  8593.  
  8594.  
  8595.  
  8596.  
  8597.           VIDEOOFF
  8598.  
  8599.             PROTOTYPE
  8600.  
  8601.             SUB VIDEOOFF ()
  8602.  
  8603.             INPUT
  8604.  
  8605.             no input parameters
  8606.  
  8607.             OUTPUT
  8608.  
  8609.             no value returned
  8610.  
  8611.             USAGE
  8612.  
  8613.             VIDEOOFF turns the output display off.  Graphics may still be
  8614.             drawn to the screen.  However, the computer's monitor will
  8615.             display nothing and appear black.  This function can be used
  8616.             to hide graphics being drawn by initially using VIDEOOFF and
  8617.             then later calling VIDEOON.
  8618.  
  8619.             SEE ALSO
  8620.  
  8621.             VIDEOON
  8622.  
  8623.             EXAMPLE
  8624.  
  8625.             REM DISABLE THE VIDEO FOR ABOUT 3 SEC
  8626.             REM $INCLUDE: 'SVGABC.BI'
  8627.             DEFINT A-Z
  8628.  
  8629.             CLS
  8630.             PRINT "PRESS A KEY TO DISABLE THE VIDEO DISPLAY FOR 3 SECONDS"
  8631.             WHILE INKEY$ = ""
  8632.             WEND
  8633.             VIDEOOFF
  8634.             SDELAY 195
  8635.             VIDEOON
  8636.             PRINT "OK...WE ARE BACK!"
  8637.             WHILE INKEY$ = ""
  8638.             WEND
  8639.             END
  8640.  
  8641.  
  8642.  
  8643.  
  8644.  
  8645.  
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.                                                                         138
  8654.  
  8655.  
  8656.  
  8657.  
  8658.  
  8659.           VIDEOON
  8660.  
  8661.             PROTOTYPE
  8662.  
  8663.             SUB VIDEOON ()
  8664.  
  8665.             INPUT
  8666.  
  8667.             no input parameters
  8668.  
  8669.             OUTPUT
  8670.  
  8671.             no value returned
  8672.  
  8673.             USAGE
  8674.  
  8675.             VIDEOON turns the display back on.  All graphics that were
  8676.             drawn while the display was off are now visible.  This
  8677.             function can be used to hide graphics being drawn by initially
  8678.             using VIDEOOFF and then later calling VIDEOON.
  8679.  
  8680.             SEE ALSO
  8681.  
  8682.             VIDEOOFF
  8683.  
  8684.             EXAMPLE
  8685.  
  8686.             See VIDEOOFF
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.  
  8699.  
  8700.  
  8701.  
  8702.  
  8703.  
  8704.  
  8705.  
  8706.  
  8707.  
  8708.  
  8709.  
  8710.  
  8711.  
  8712.  
  8713.  
  8714.  
  8715.                                                                         139
  8716.  
  8717.  
  8718.  
  8719.  
  8720.  
  8721.           WHICHCPU
  8722.  
  8723.             PROTOTYPE
  8724.  
  8725.             FUNCTION WHICHCPU% ()
  8726.  
  8727.             INPUT
  8728.  
  8729.             no input parameters
  8730.  
  8731.             OUTPUT
  8732.  
  8733.             WHICHCPU returns the processor type.
  8734.  
  8735.             USAGE
  8736.  
  8737.             WHICHCPU returns the computer's processor type as 86, 286, 386
  8738.             or 486.  This function should be called by any program using
  8739.             this library's routines to insure that the computer is at
  8740.             least 386 compatible or better.
  8741.  
  8742.             SEE ALSO
  8743.  
  8744.             WHICHJOYSTICK, WHICHMOUSE, WHICHVGA
  8745.  
  8746.             EXAMPLE
  8747.  
  8748.             REM FIND OUT WHAT KIND OF MICROPROCESSOR WE HAVE
  8749.             REM $INCLUDE: 'SVGABC.BI'
  8750.             DEFINT A-Z
  8751.  
  8752.             CLS
  8753.             CPU = WHICHCPU
  8754.             CPU$ = STR$(CPU)
  8755.             L = LEN(CPU$)
  8756.             CPU$ = RIGHT$(CPU$, L - 1)
  8757.             PRINT "Microprocessor is identified as a 80"; CPU$; "."
  8758.             END
  8759.  
  8760.  
  8761.  
  8762.  
  8763.  
  8764.  
  8765.  
  8766.  
  8767.  
  8768.  
  8769.  
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.                                                                         140
  8778.  
  8779.  
  8780.  
  8781.  
  8782.  
  8783.           WHICHJOYSTICK
  8784.  
  8785.             PROTOTYPE
  8786.  
  8787.             FUNCTION WHICHJOYSTICK% ()
  8788.  
  8789.             INPUT
  8790.  
  8791.             no input parameters
  8792.  
  8793.             OUTPUT
  8794.  
  8795.             WHICHJOYSTICK returns the available joystick support.
  8796.  
  8797.             USAGE
  8798.  
  8799.             WHICHJOYSTICK returns the joystick support available on the
  8800.             computer.  This function should be called prior to use of the
  8801.             joysticks to verify that joysticks are available.  If the
  8802.             function returns a -1, there is no joystick port present or no
  8803.             BIOS support for a joystick.  Joystick A is bit 1 and B is bit
  8804.             2.  Therefore, a return value of 1 means joystick A is
  8805.             available, a value of 2 means B is available and a value of 3
  8806.             means both are available.  If no bits are set, there are no
  8807.             joysticks present.
  8808.  
  8809.             SEE ALSO
  8810.  
  8811.             JOYSTICKINFO, WHICHCPU, WHICHMOUSE, WHICHVGA, APPENDIX B.
  8812.             JOYSTICK Y-CABLES
  8813.  
  8814.             EXAMPLE
  8815.  
  8816.             REM FIND OUT IF WE HAVE ANY JOYSTICKS AVAILABLE
  8817.             REM $INCLUDE: 'SVGABC.BI'
  8818.             DEFINT A-Z
  8819.  
  8820.             CLS
  8821.             JOYSTICK = WHICHJOYSTICK
  8822.             SELECT CASE JOYSTICK
  8823.                CASE IS = -1
  8824.                  A$ = "No joystick port detected or no joystick BIOS
  8825.             support present."
  8826.                CASE IS = 0
  8827.                  A$ = "No joystick detected."
  8828.                CASE IS = 1
  8829.                  A$ = "Joystick A is present and available."
  8830.                CASE IS = 2
  8831.                  A$ = "Joystick B is present and available."
  8832.                CASE IS = 3
  8833.                  A$ = "Both Joystick A and Joystick B are present and
  8834.             available."
  8835.             END SELECT
  8836.             PRINT A$
  8837.  
  8838.  
  8839.                                                                         141
  8840.  
  8841.  
  8842.  
  8843.  
  8844.  
  8845.             END
  8846.  
  8847.  
  8848.  
  8849.  
  8850.  
  8851.  
  8852.  
  8853.  
  8854.  
  8855.  
  8856.  
  8857.  
  8858.  
  8859.  
  8860.  
  8861.  
  8862.  
  8863.  
  8864.  
  8865.  
  8866.  
  8867.  
  8868.  
  8869.  
  8870.  
  8871.  
  8872.  
  8873.  
  8874.  
  8875.  
  8876.  
  8877.  
  8878.  
  8879.  
  8880.  
  8881.  
  8882.  
  8883.  
  8884.  
  8885.  
  8886.  
  8887.  
  8888.  
  8889.  
  8890.  
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.  
  8897.  
  8898.  
  8899.  
  8900.  
  8901.                                                                         142
  8902.  
  8903.  
  8904.  
  8905.  
  8906.  
  8907.           WHICHMEM
  8908.  
  8909.             PROTOTYPE
  8910.  
  8911.             FUNCTION WHICHMEM% ()
  8912.  
  8913.             INPUT
  8914.  
  8915.             no input parameters
  8916.  
  8917.             OUTPUT
  8918.  
  8919.             WHICHMEM returns the installed video memory in kilobytes.
  8920.  
  8921.             USAGE
  8922.  
  8923.             WHICHMEM returns the amount of installed video memory as
  8924.             previously determined by WHICHVGA.  WHICHVGA should be called
  8925.             prior to WHICHMEM.  This function should be called prior to
  8926.             any of the RES### functions to verify that there is enough
  8927.             memory to support the resolution.  If SETCARD was used to set
  8928.             the video card and memory, WHICHMEM will return the amount of
  8929.             memory as defined by SETCARD.
  8930.  
  8931.             SEE ALSO
  8932.  
  8933.             RES320, RES640, RES640L, RES800, RES1024, SETCARD, WHICHVGA
  8934.  
  8935.             EXAMPLE
  8936.  
  8937.             REM FIND OUT HOW MUCH VIDEO MEMORY WE HAVE
  8938.             REM $INCLUDE: 'SVGABC.BI'
  8939.             DEFINT A-Z
  8940.  
  8941.             CLS
  8942.             DUMMY = WHICHVGA
  8943.             PRINT "INSTALLED VIDEO MEMORY IS IDENTIFIED AS"; WHICHMEM; "k
  8944.             BYTES"
  8945.             END
  8946.  
  8947.  
  8948.  
  8949.  
  8950.  
  8951.  
  8952.  
  8953.  
  8954.  
  8955.  
  8956.  
  8957.  
  8958.  
  8959.  
  8960.  
  8961.  
  8962.  
  8963.                                                                         143
  8964.  
  8965.  
  8966.  
  8967.  
  8968.  
  8969.           WHICHMOUSE
  8970.  
  8971.             PROTOTYPE
  8972.  
  8973.             FUNCTION WHICHMOUSE% ()
  8974.  
  8975.             INPUT
  8976.  
  8977.             no input parameters
  8978.  
  8979.             OUTPUT
  8980.  
  8981.             WHICHMOUSE returns the number of buttons on mouse.
  8982.  
  8983.             USAGE
  8984.  
  8985.             WHICHMOUSE returns a value indicating whether a Microsoft
  8986.             compatible mouse is available.  If the function returns 0, no
  8987.             mouse is available.  A non zero value indicates a mouse and
  8988.             Microsoft compatible driver are installed and gives the number
  8989.             of buttons available.
  8990.  
  8991.             SEE ALSO
  8992.  
  8993.             MOUSEINFO, WHICHCPU, WHICHJOYSTICK, WHICHVGA
  8994.  
  8995.             EXAMPLE
  8996.  
  8997.             REM FIND OUT WHAT KIND OF MOUSE WE HAVE
  8998.             REM $INCLUDE: 'SVGABC.BI'
  8999.             DEFINT A-Z
  9000.  
  9001.             CLS
  9002.             MOUSE = WHICHMOUSE
  9003.             IF MOUSE > 0 THEN
  9004.                MOUSEINFO MJV, MNV, TP, I
  9005.                VER$ = STR$(MNV)
  9006.                L = LEN(VER$)
  9007.                VER$ = STR$(MJV) + "." + RIGHT$(VER$, L - 1)
  9008.                VER$ = "Software driver version is" + VER$
  9009.                VER$ = VER$ + " (Microsoft equivalent version)."
  9010.                A$ = "Microsoft compatible mouse detected with"
  9011.                A$ = A$ + STR$(MOUSE) + " buttons on IRQ" + STR$(I) + "."
  9012.                PRINT A$
  9013.                PRINT VER$
  9014.             ELSE
  9015.                PRINT "No Microsoft compatible mouse detected."
  9016.             END IF
  9017.             END
  9018.  
  9019.  
  9020.  
  9021.  
  9022.  
  9023.  
  9024.  
  9025.                                                                         144
  9026.  
  9027.  
  9028.  
  9029.  
  9030.  
  9031.           WHICHVGA
  9032.  
  9033.             PROTOTYPE
  9034.  
  9035.             FUNCTION WHICHVGA% ()
  9036.  
  9037.             INPUT
  9038.  
  9039.             no input parameters
  9040.  
  9041.             OUTPUT
  9042.  
  9043.             WHICHVGA returns a code identifying the video card.
  9044.  
  9045.             USAGE
  9046.  
  9047.             WHICHVGA identifies the video card installed and the amount of
  9048.             video memory.  In addition this function sets up the default
  9049.             font and mouse cursor.  This function must be called before
  9050.             any other graphics function.  The code returned identifies the
  9051.             video card according to the following table:
  9052.  
  9053.           1  Acumos AVGA2/3 SuperVGA
  9054.           2  ATI Technologies 18/28/38/68800 SuperVGA
  9055.           3  Ahead V5000 ver A SuperVGA
  9056.           4  Ahead V5000 ver B SuperVGA
  9057.           5  Chips and Technologies 82C45x SuperVGA
  9058.           6  Cirrus Logic CL-GD 5xx, 6xx, 28xx, 54xx, 62xx SuperVGA
  9059.           7  Everex Micro Enhancer Ev236/6xx SuperVGA
  9060.           8  Genoa 61/62/63/64/6600 SuperVGA
  9061.           9  NCR 77C21/22/22E/22E+ SuperVGA
  9062.           10 Oak Technologies OTI-037C/067/077/087 SuperVGA
  9063.           11 Paradise/Western Digital PVGA1A, WD90C00/1x/2x/3x SuperVGA
  9064.           12 Realtek RT3106 SuperVGA
  9065.           13 Trident 8800CS, 8900B/C/CL/CX, 90x0 SuperVGA
  9066.           14 Tseng Labs ET3000-AX/BX/BP SuperVGA
  9067.           15 Tseng Labs ET4000/W32/W32I SuperVGA
  9068.           16 VESA compatible SuperVGA
  9069.           17 Video 7 HT-208/16 SuperVGA
  9070.           18 Avance Logic AL2101 SuperVGA
  9071.           19 MXIC MX68000/10 SuperVGA
  9072.           20 Primus P2000 SuperVGA
  9073.  
  9074.             Any value returned not found on this table represents an
  9075.             unidentified video card.
  9076.  
  9077.             No graphics functions should be called unless the video card
  9078.             is properly identified.
  9079.  
  9080.             SEE ALSO
  9081.  
  9082.             SETCARD, WHICHCPU, WHICHJOYSTICK, WHICHMOUSE, WHICHMEM
  9083.  
  9084.             EXAMPLE
  9085.  
  9086.  
  9087.                                                                         145
  9088.  
  9089.  
  9090.  
  9091.  
  9092.  
  9093.  
  9094.             REM FIND OUT WHAT KIND OF VIDEO CARD WE HAVE
  9095.             DEFINT A-Z
  9096.  
  9097.             CLS
  9098.             VGA = WHICHVGA
  9099.             SELECT CASE VGA
  9100.                  CASE IS = 1
  9101.                     VGA$ = "Acumos AVGA2/3 SuperVGA"
  9102.                  CASE IS = 2
  9103.                     VGA$ = "ATI Technologies 18/28/38/68800 SuperVGA"
  9104.                  CASE IS = 3
  9105.                       VGA$ = "Ahead V5000 ver A SuperVGA"
  9106.                  CASE IS = 4
  9107.                     VGA$ = "Ahead V5000 ver B SuperVGA"
  9108.                  CASE IS = 5
  9109.                     VGA$ = "Chips and Technologies 82C450/1/2/3/5/6/7
  9110.           SuperVGA"
  9111.                  CASE IS = 6
  9112.                     VGA$ = "Cirrus Logic CL-GD 5xx,6xx,28xx,54xx,62xx
  9113.           SuperVGA"
  9114.                  CASE IS = 7
  9115.                     VGA$ = "Everex Ev236/6xx Micro Enhancer SuperVGA"
  9116.                  CASE IS = 8
  9117.                     VGA$ = "Genoa 61/62/63/64/6600 SuperVGA"
  9118.                  CASE IS = 9
  9119.                     VGA$ = "NCR 77C21/22/22E/22E+ SuperVGA"
  9120.                  CASE IS = 10
  9121.                     VGA$ = "Oak Technologies OTI-037C/067/077/087 SuperVGA"
  9122.                  CASE IS = 11
  9123.                     VGA$ = "Paradise/Western Digital
  9124.           PVGA1A,WD90C00/1x/2x/3x SuperVGA"
  9125.                  CASE IS = 12
  9126.                     VGA$ = "Realtek RT3106 SuperVGA"
  9127.                  CASE IS = 13
  9128.                     VGA$ = "Trident 8800CS,8900B/C/CL/CX,90x0 SuperVGA"
  9129.                  CASE IS = 14
  9130.                     VGA$ = "Tseng Labs ET3000-AX/BX/BP SuperVGA"
  9131.                  CASE IS = 15
  9132.                     VGA$ = "Tseng Labs ET4000/W32/W32I SuperVGA"
  9133.                  CASE IS = 16
  9134.                     VGA$ = "VESA compatible SuperVGA"
  9135.                  CASE IS = 17
  9136.                     VGA$ = "Video 7 HT-208/16 SuperVGA"
  9137.                  CASE IS = 18
  9138.                     VGA$ = "Avance Logic AL2101 SuperVGA"
  9139.                  CASE IS = 19
  9140.                     VGA$ = "MXIC MX68000/10 SuperVGA"
  9141.                  CASE IS = 20
  9142.                     VGA$ = "Primus P2000 SuperVGA"
  9143.                  CASE ELSE
  9144.                     VGA$ = "Unknown"
  9145.                     VGA = 0
  9146.             END SELECT
  9147.  
  9148.  
  9149.                                                                         146
  9150.  
  9151.  
  9152.  
  9153.  
  9154.  
  9155.             PRINT "Video card/chip is identified as a "; VGA$; "."
  9156.             END
  9157.  
  9158.  
  9159.  
  9160.  
  9161.  
  9162.  
  9163.  
  9164.  
  9165.  
  9166.  
  9167.  
  9168.  
  9169.  
  9170.  
  9171.  
  9172.  
  9173.  
  9174.  
  9175.  
  9176.  
  9177.  
  9178.  
  9179.  
  9180.  
  9181.  
  9182.  
  9183.  
  9184.  
  9185.  
  9186.  
  9187.  
  9188.  
  9189.  
  9190.  
  9191.  
  9192.  
  9193.  
  9194.  
  9195.  
  9196.  
  9197.  
  9198.  
  9199.  
  9200.  
  9201.  
  9202.  
  9203.  
  9204.  
  9205.  
  9206.  
  9207.  
  9208.  
  9209.  
  9210.  
  9211.                                                                         147
  9212.  
  9213.  
  9214.  
  9215.  
  9216.  
  9217.           WHICHXMS
  9218.  
  9219.             PROTOTYPE
  9220.  
  9221.             FUNCTION WHICHXMS% (XmsKBytesAvailable%, XmsHandlesAvailable%)
  9222.  
  9223.             INPUT
  9224.  
  9225.             no input parameters
  9226.  
  9227.             OUTPUT
  9228.  
  9229.             WHICHXMS returns a 1 if extended memory support is detected, 0
  9230.             otherwise.
  9231.             XmsKBytesAvailable - number of free kilobytes in extended
  9232.             memory
  9233.             XmsHandlesAvailable - number of available free handles
  9234.  
  9235.             USAGE
  9236.  
  9237.             WHICHXMS detects the existence of extended memory support and
  9238.             sets up the library function calls.  This function must be
  9239.             called before any other extended memory functions.  WHICHXMS
  9240.             also returns the number of free kilobytes of extended memory
  9241.             and the number of available handles.  The number of available
  9242.             handles is limited, normally to 32.  This limit can be
  9243.             modified by changing the extended memory driver (Microsoft's
  9244.             HIMEM.SYS is the most common) command line in the CONFIG.SYS
  9245.             file.
  9246.  
  9247.             SEE ALSO
  9248.  
  9249.             XMSALLOCATE, XMSCOPY, XMSERROR, XMSFREE, XMSGET, XMSPUT
  9250.  
  9251.             EXAMPLE
  9252.  
  9253.             REM THIS WILL SHOW IF XMS MEMORY IS AVAILABLE AND HOW MUCH
  9254.             REM $INCLUDE: 'SVGABC.BI'
  9255.             DEFINT A-Z
  9256.             IF WHICHXMS(MEM, HANDLES) = 1 THEN
  9257.                PRINT "AN XMS MEMORY MANAGER IS INSTALLED (SUCH AS
  9258.             'HIMEM.SYS')"
  9259.                IF MEM > 0 THEN
  9260.                  TOTMEM& = 1024
  9261.                  TOTMEM& = TOTMEM& * MEM
  9262.                  PRINT "A TOTAL OF"; TOTMEM&; "BYTES ARE AVAILABLE"
  9263.                  IF HANDLES > 0 THEN
  9264.                     PRINT "A TOTAL OF"; HANDLES; "HANDLES(S) ARE AVAILABLE"
  9265.                     PRINT "XMS MEMORY IS READY FOR USE"
  9266.                  ELSE
  9267.                     PRINT "SORRY...ALL XMS HANDLES ARE BEING USED"
  9268.                     PRINT "CHANGE (OR ADD) THE '/numhandles' SWITCH ON YOUR
  9269.             XMS MEMORY MANAGER"
  9270.                  END IF
  9271.  
  9272.  
  9273.                                                                         148
  9274.  
  9275.  
  9276.  
  9277.  
  9278.  
  9279.                ELSE
  9280.                  PRINT "SORRY...ALL XMS MEMORY IS ALLOCATED"
  9281.                END IF
  9282.             ELSE
  9283.                PRINT "SORRY...NO ACTIVE XMS MEMORY MANAGER FOUND"
  9284.                PRINT "MAKE SURE YOU HAVE AN XMS MEMORY MANAGER (SUCH AS
  9285.             'HIMEM.SYS' INSTALLED)"
  9286.             END IF
  9287.             END
  9288.  
  9289.  
  9290.  
  9291.  
  9292.  
  9293.  
  9294.  
  9295.  
  9296.  
  9297.  
  9298.  
  9299.  
  9300.  
  9301.  
  9302.  
  9303.  
  9304.  
  9305.  
  9306.  
  9307.  
  9308.  
  9309.  
  9310.  
  9311.  
  9312.  
  9313.  
  9314.  
  9315.  
  9316.  
  9317.  
  9318.  
  9319.  
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325.  
  9326.  
  9327.  
  9328.  
  9329.  
  9330.  
  9331.  
  9332.  
  9333.  
  9334.  
  9335.                                                                         149
  9336.  
  9337.  
  9338.  
  9339.  
  9340.  
  9341.           XMSALLOCATE
  9342.  
  9343.             PROTOTYPE
  9344.  
  9345.             FUNCTION XMSALLOCATE% (RequestedKBytes%)
  9346.  
  9347.             INPUT
  9348.  
  9349.             RequestedKBytes - requested number of kilobytes of extended
  9350.             memory
  9351.  
  9352.             OUTPUT
  9353.  
  9354.             XMSALLOCATE returns the assigned memory handle if the
  9355.             allocation is successful, 0 otherwise.
  9356.  
  9357.             USAGE
  9358.  
  9359.             XMSALLOCATE attempts to allocate the requested number of
  9360.             kilobytes in extended memory.  If successful, the function
  9361.             returns the handle of the new memory block.  If the function
  9362.             returns zero, then the allocation was unsuccessful; check
  9363.             XMSERROR for error codes.
  9364.  
  9365.             All allocated blocks must be freed using XMSFREE before a
  9366.             program terminates or the memory is lost until the machine is
  9367.             rebooted.  Simply exiting a program will not free allocated
  9368.             extended memory blocks.
  9369.  
  9370.             SEE ALSO
  9371.  
  9372.             WHICHXMS, XMSCOPY, XMSERROR, XMSFREE, XMSGET, XMSPUT
  9373.  
  9374.             EXAMPLE
  9375.  
  9376.             See XMSCOPY
  9377.  
  9378.  
  9379.  
  9380.  
  9381.  
  9382.  
  9383.  
  9384.  
  9385.  
  9386.  
  9387.  
  9388.  
  9389.  
  9390.  
  9391.  
  9392.  
  9393.  
  9394.  
  9395.  
  9396.  
  9397.                                                                         150
  9398.  
  9399.  
  9400.  
  9401.  
  9402.  
  9403.           XMSCOPY
  9404.  
  9405.             PROTOTYPE
  9406.  
  9407.             FUNCTION XMSCOPY% (SrcXmsHandle%, SrcOffset&, DestXmsHandle%,
  9408.             DestOffset&, NumBytes&)
  9409.  
  9410.             INPUT
  9411.  
  9412.             SrcXmsHandle - handle of source extended memory block
  9413.             SrcOffset - number of bytes from beginning of source memory
  9414.             block
  9415.             DestXmsHandle - handle of destination extended memory block
  9416.             DestOffset - number of bytes from beginning of destination
  9417.             memory block
  9418.             NumBytes - number of bytes to copy from source to destination
  9419.             (must be even)
  9420.  
  9421.             OUTPUT
  9422.  
  9423.             XMSCOPY returns a 1 if copy was successful, 0 otherwise.
  9424.  
  9425.             USAGE
  9426.  
  9427.             XMSCOPY copies the number of bytes specified in NumBytes from
  9428.             the source extended memory block to the destination extended
  9429.             memory block.  NumBytes must be an even number.  The copy may
  9430.             begin and/or end offset from the beginning of the source and
  9431.             destination blocks by passing non zero values in SrcOffset
  9432.             and/or DestOffset.  The copy will occur faster if both offsets
  9433.             are divisible by four.  If the copy was unsuccessful, check
  9434.             XMSERROR for error codes.
  9435.  
  9436.             SEE ALSO
  9437.  
  9438.             WHICHXMS, XMSALLOCATE, XMSERROR, XMSFREE, XMSGET, XMSPUT
  9439.  
  9440.             EXAMPLE
  9441.  
  9442.             REM THIS WILL COPY ONE ARRAY INTO ONE XMS BLOCK AND THEN COPY
  9443.             IT
  9444.             REM TO A DIFFERENT XMS BLOCK, AND THEN COPY THAT BACK INTO
  9445.             ANOTHER ARRAY
  9446.             REM $INCLUDE: 'SVGABC.BI'
  9447.             DEFINT A-Z
  9448.  
  9449.             REM *DIMENSION OUR SOURCE AND DESTINATION ARRAYS*
  9450.             DIM TEST1(0 TO 9) AS INTEGER
  9451.             DIM TEST2(0 TO 9) AS INTEGER
  9452.             CLS
  9453.  
  9454.             REM *MAKE SURE XMS IS READY AND AVAILBLE*
  9455.             IF WHICHXMS(MEM, HANDLES) = 1 THEN
  9456.                IF MEM < 1 OR HANDLES < 1 THEN
  9457.  
  9458.  
  9459.                                                                         151
  9460.  
  9461.  
  9462.  
  9463.  
  9464.  
  9465.                  PRINT "SORRY...THERE IS EITHER NO FREE XMS MEMORY OR NO
  9466.             FREE XMS HANDLES"
  9467.                  END
  9468.                END IF
  9469.             ELSE
  9470.                PRINT "SORRY...NO ACTIVE XMS MEMORY MANAGER FOUND"
  9471.                PRINT "MAKE SURE YOU HAVE A XMS MEMORY MANAGER (SUCH AS
  9472.             'HIMEM.SYS' INSTALLED)"
  9473.                END
  9474.             END IF
  9475.  
  9476.             REM *PUT SOME DATA INTO THE SOURCE ARRAY*
  9477.             FOR I = 0 TO 9
  9478.                TEST1(I) = I * 10
  9479.             NEXT I
  9480.  
  9481.             REM *ALLOCATE THE FIRST XMS MEMORY BLOCK*
  9482.             OurHandle1 = XMSALLOCATE(1)
  9483.             IF OurHandle1 = 0 THEN
  9484.                PRINT "OPPS..THERE IS SOME ERROR...UNABLE TO ALLOCATE XMS"
  9485.                PRINT "ERROR #"; XMSERROR
  9486.                ER = XMSFREE(OurHandle1)
  9487.                END
  9488.             END IF
  9489.  
  9490.             REM *ALLOCATE THE SECOND XMS MEMORY BLOCK*
  9491.             OurHandle2 = XMSALLOCATE(1)
  9492.             IF OurHandle2 = 0 THEN
  9493.                PRINT "OPPS..THERE IS SOME ERROR...UNABLE TO ALLOCATE XMS"
  9494.                PRINT "ERROR #"; XMSERROR
  9495.                ER = XMSFREE(OurHandle1)
  9496.                ER = XMSFREE(OurHandle2)
  9497.                END
  9498.             END IF
  9499.  
  9500.             REM *COPY OUR SOURCE ARRAY INTO OUR FIRST XMS BLOCK*
  9501.             I = XMSPUT(TEST1(0), OurHandle1, 0, 20)
  9502.             IF I = 0 THEN
  9503.                PRINT "OPPS..THERE IS SOME ERROR...SEE THE ERROR CODE
  9504.             LIST..."
  9505.                PRINT "ERROR #"; XMSERROR
  9506.                ER = XMSFREE(OurHandle1)
  9507.                ER = XMSFREE(OurHandle2)
  9508.                END
  9509.             END IF
  9510.  
  9511.             REM *COPY THE FIRST XMS BLOCK TO THE SECOND XMS BLOCK*
  9512.             IF XMSCOPY(OurHandle1, 0, OurHandle2, 0, 20) = 0 THEN
  9513.                PRINT "OPPS..THERE IS SOME ERROR...SEE THE ERROR CODE
  9514.             LIST..."
  9515.                PRINT "ERROR #"; XMSERROR
  9516.                ER = XMSFREE(OurHandle1)
  9517.                ER = XMSFREE(OurHandle2)
  9518.                END
  9519.  
  9520.  
  9521.                                                                         152
  9522.  
  9523.  
  9524.  
  9525.  
  9526.  
  9527.             END IF
  9528.  
  9529.             REM *COPY DATA FROM THE SECOND XMS BLOCK TO OUR DESTINATION
  9530.             ARRAY*
  9531.             IF XMSGET(OurHandle2, 0, TEST2(0), 20) = 0 THEN
  9532.                PRINT "OPPS..THERE IS SOME ERROR...SEE THE ERROR CODE
  9533.             LIST..."
  9534.                PRINT "ERROR #"; ER
  9535.                ER = XMSFREE(OurHandle1)
  9536.                ER = XMSFREE(OurHandle2)
  9537.                END
  9538.             END IF
  9539.  
  9540.             REM *FREE THE XMS BLOCKS WE HAVE ALLOCATED*
  9541.             ER = XMSFREE(OurHandle1)
  9542.             ER = XMSFREE(OurHandle2)
  9543.  
  9544.             REM *SHOW THE RESULTS*
  9545.             PRINT "OK...WE INITILIZED ONE ARRAY,PUT A COPY OF IT INTO
  9546.             XMS,"
  9547.             PRINT "THEN WE COPIED THAT XMS BLOCK TO ANOTHER XMS BLOCK,
  9548.             AND"
  9549.             PRINT "THEN PUT A COPY OF THE SECOND XMS BLOCK INTO A NEW
  9550.             ARRAY;"
  9551.             PRINT "HERE ARE THE RESULTS:"
  9552.             PRINT
  9553.             PRINT "SOURCE ARRAY", , "DESTINATION ARRAY"
  9554.             FOR I = 0 TO 9
  9555.                PRINT TEST1(I), , TEST2(I)
  9556.             NEXT I
  9557.             END
  9558.  
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575.  
  9576.  
  9577.  
  9578.  
  9579.  
  9580.  
  9581.  
  9582.  
  9583.                                                                         153
  9584.  
  9585.  
  9586.  
  9587.  
  9588.  
  9589.           XMSERROR
  9590.  
  9591.             PROTOTYPE
  9592.  
  9593.             FUNCTION XMSERROR% ()
  9594.  
  9595.             INPUT
  9596.  
  9597.             no input parameters
  9598.  
  9599.             OUTPUT
  9600.  
  9601.             XMSERROR returns the error code from the most recent XMS
  9602.             function call.
  9603.  
  9604.             USAGE
  9605.  
  9606.             XMSERROR returns the error code from the most recent XMS
  9607.             function call.  Each XMS function resets the error code to
  9608.             zero.  Therefore, if there has been an error, the error code
  9609.             should be checked immediately.  The error code will be one of
  9610.             the following:
  9611.  
  9612.           0   no error
  9613.           1   WHICHXMS has not been called
  9614.           2   number of bytes to copy is zero
  9615.           3   number of bytes to copy is odd
  9616.           4   offset into XMS block is zero
  9617.           128 Function not implemented
  9618.           129 VDISK device driver was detected
  9619.           142 General driver error
  9620.           143 Unrecoverable driver error
  9621.           146 DX is less than /HMAMIN= parameter
  9622.           160 All extended memory is allocated
  9623.           161 XMM handles are exhausted
  9624.           162 Handle is invalid
  9625.           163 Source handle is invalid
  9626.           164 Source offset is invalid
  9627.           165 Destination handle is invalid
  9628.           166 Destination offset is invalid
  9629.           167 Length is invalid
  9630.           168 Overlap in move request is invalid
  9631.           169 Parity error detected
  9632.           171 Block locked
  9633.  
  9634.             SEE ALSO
  9635.  
  9636.             WHICHXMS, XMSALLOCATE, XMSCOPY, XMSFREE, XMSGET, XMSPUT
  9637.  
  9638.             EXAMPLE
  9639.  
  9640.             See XMSCOPY
  9641.  
  9642.  
  9643.  
  9644.  
  9645.                                                                         154
  9646.  
  9647.  
  9648.  
  9649.  
  9650.  
  9651.           XMSFREE
  9652.  
  9653.             PROTOTYPE
  9654.  
  9655.             FUNCTION XMSFREE% (XmsHandle%)
  9656.  
  9657.             INPUT
  9658.  
  9659.             XmsHandle - handle of extended memory block to free
  9660.  
  9661.             OUTPUT
  9662.  
  9663.             XMSFREE returns 1 if extended memory block was deallocated, 0
  9664.             otherwise.
  9665.  
  9666.             USAGE
  9667.  
  9668.             XMSFREE deallocates the specified extended memory block.  All
  9669.             allocated blocks must be freed before a program terminates or
  9670.             the memory is lost until the machine is rebooted.  Simply
  9671.             exiting a program will not free allocated extended memory
  9672.             blocks.  If the function was unsuccessful, check XMSERROR for
  9673.             error codes.
  9674.  
  9675.             SEE ALSO
  9676.  
  9677.             WHICHXMS, XMSALLOCATE, XMSCOPY, XMSERROR, XMSGET, XMSPUT
  9678.  
  9679.             EXAMPLE
  9680.  
  9681.             See XMSCOPY
  9682.  
  9683.  
  9684.  
  9685.  
  9686.  
  9687.  
  9688.  
  9689.  
  9690.  
  9691.  
  9692.  
  9693.  
  9694.  
  9695.  
  9696.  
  9697.  
  9698.  
  9699.  
  9700.  
  9701.  
  9702.  
  9703.  
  9704.  
  9705.  
  9706.  
  9707.                                                                         155
  9708.  
  9709.  
  9710.  
  9711.  
  9712.  
  9713.           XMSGET
  9714.  
  9715.             PROTOTYPE
  9716.  
  9717.             FUNCTION XMSGET% (SrcXmsHandle%, SrcOffset&, DestVariable%,
  9718.             NumBytes&)
  9719.  
  9720.             INPUT
  9721.  
  9722.             SrcXmsHandle - handle of source extended memory block
  9723.             SrcOffset - number of bytes from beginning of source memory
  9724.             block
  9725.             NumBytes - number of bytes to copy from extended memory to
  9726.             conventional memory (must be even)
  9727.  
  9728.             OUTPUT
  9729.  
  9730.             XMSGET returns 0 if the copy was successful, an error code
  9731.             otherwise.
  9732.             DestVariable - integer variable or array holding copied data
  9733.  
  9734.             USAGE
  9735.  
  9736.             XMSGET retrieves data from extended memory and places it in
  9737.             conventional memory.  The number of bytes copied must be an
  9738.             even number and cannot be larger than 65536.  The copy may
  9739.             begin off the beginning of the source extended memory block by
  9740.             specifying a non zero SrcOffset.  If the function was
  9741.             unsuccessful, check XMSERROR for error codes.
  9742.  
  9743.             SEE ALSO
  9744.  
  9745.             WHICHXMS, XMSALLOCATE, XMSCOPY, XMSERROR, XMSFREE, XMSPUT
  9746.  
  9747.             EXAMPLE
  9748.  
  9749.             See XMSCOPY
  9750.  
  9751.  
  9752.  
  9753.  
  9754.  
  9755.  
  9756.  
  9757.  
  9758.  
  9759.  
  9760.  
  9761.  
  9762.  
  9763.  
  9764.  
  9765.  
  9766.  
  9767.  
  9768.  
  9769.                                                                         156
  9770.  
  9771.  
  9772.  
  9773.  
  9774.  
  9775.           XMSPUT
  9776.  
  9777.             PROTOTYPE
  9778.  
  9779.             FUNCTION XMSPUT% (SrcVariable%, DestXmsHandle%, DestOffset&,
  9780.             NumBytes&)
  9781.  
  9782.             INPUT
  9783.  
  9784.             SrcVariable - source variable or array in conventional memory
  9785.             DestXmsHandle - handle of destination extended memory block
  9786.             DestOffset - number of bytes from beginning of destination
  9787.             memory block
  9788.             NumBytes - number of bytes to copy from conventional memory to
  9789.             extended memory (must be even)
  9790.  
  9791.             OUTPUT
  9792.  
  9793.             XMSPUT returns 1 if the copy was successful, 0 otherwise.
  9794.  
  9795.             USAGE
  9796.  
  9797.             XMSPUT copies data from conventional memory to extended
  9798.             memory.  The number of bytes copied must be an even number and
  9799.             cannot be larger than 65536.  The destination may begin off
  9800.             the beginning of the extended memory block by specifying a non
  9801.             zero DestOffset.  If the function was unsuccessful, check
  9802.             XMSERROR for error codes.
  9803.  
  9804.             SEE ALSO
  9805.  
  9806.             WHICHXMS, XMSALLOCATE, XMSCOPY, XMSERROR, XMSFREE, XMSGET
  9807.  
  9808.             EXAMPLE
  9809.  
  9810.             See XMSCOPY
  9811.  
  9812.  
  9813.  
  9814.  
  9815.  
  9816.  
  9817.  
  9818.  
  9819.  
  9820.  
  9821.  
  9822.  
  9823.  
  9824.  
  9825.  
  9826.  
  9827.  
  9828.  
  9829.  
  9830.  
  9831.                                                                         157
  9832.  
  9833.  
  9834.  
  9835.  
  9836.  
  9837.           APPENDIX A.  SVGABC.BI
  9838.  
  9839.           This is the header file containing function declarations and
  9840.           structure definitions for SVGAQB.LIB and SVGAPV.LIB.  This file
  9841.           should be included in every program that uses this library.  To
  9842.           properly include the header file, place the following line at the
  9843.           top of the every program module:
  9844.  
  9845.                               REM $INCLUDE: 'SVGABC.BI'
  9846.  
  9847.           Without these declarations and definitions, the QuickBasic
  9848.           compiler will be unable to compile any program using the commands
  9849.           found in this library.
  9850.  
  9851.             REM SVGAQB/PV GRAPHICS LIBRARY INCLUDE FILE FOR MS QuickBASIC
  9852.                4.x/VBDOS/PDS
  9853.             REM COPYRIGHT 1993-1994 BY STEPHEN L. BALKUM AND DANIEL A.
  9854.                SILL
  9855.             REM ZEPHYR SOFTWARE P.O. BOX 7704, AUSTIN, TEXAS  78713-7704
  9856.             REM LAST UPDATE 3/1/94
  9857.  
  9858.             TYPE P2DType
  9859.                X AS INTEGER
  9860.                Y AS INTEGER
  9861.             END TYPE
  9862.  
  9863.             TYPE P3Dtype
  9864.                X AS INTEGER
  9865.                Y AS INTEGER
  9866.                Z AS INTEGER
  9867.             END TYPE
  9868.  
  9869.             TYPE PROJType
  9870.                EYEX AS INTEGER
  9871.                EYEY AS INTEGER
  9872.                EYEZ AS INTEGER
  9873.                SCRD AS INTEGER
  9874.                THETA AS INTEGER
  9875.                PHI AS INTEGER
  9876.             END TYPE
  9877.  
  9878.             DECLARE SUB BLKGET (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
  9879.                Y2%, SEG GfxBlk%)
  9880.             DECLARE SUB BLKPUT (BYVAL Mode%, BYVAL X%, BYVAL Y%, SEG
  9881.                GfxBlk%)
  9882.             DECLARE SUB BLKRESIZE (BYVAL X%, BYVAL Y%, SEG SourceGfxBlk%,
  9883.                SEG DestGfxBlk%)
  9884.             DECLARE FUNCTION BLKROTATE% (BYVAL Ang%, BYVAL BackFill%, SEG
  9885.                SourceGfxBlk%, SEG DestGfxBlk%)
  9886.             DECLARE FUNCTION BLKROTATESIZE& (BYVAL Ang%, SEG
  9887.                SourceGfxBlk%)
  9888.             DECLARE SUB BYTECOPY (SEG SourceArray%, SEG DestArray%, BYVAL
  9889.                NumOfBytes&)
  9890.  
  9891.  
  9892.  
  9893.                                                                         158
  9894.  
  9895.  
  9896.  
  9897.  
  9898.  
  9899.             DECLARE SUB D2ROTATE (BYVAL Points%, BYVAL XOrigin%, BYVAL
  9900.                YOrigin%, BYVAL Ang%, SEG InAry%, SEG OutAry%)
  9901.             DECLARE SUB D2SCALE (BYVAL Points%, BYVAL XSCALE%, BYVAL
  9902.                YSCALE%, SEG InAry%, SEG OutAry%)
  9903.             DECLARE SUB D2TRANSLATE (BYVAL Points%, BYVAL XTRANS%, BYVAL
  9904.                YTRANS%, SEG InAry%, SEG OutAry%)
  9905.             DECLARE FUNCTION D3PROJECT% (BYVAL Points%, SEG ProjParms%,
  9906.                SEG InAry%, SEG OutAry%)
  9907.             DECLARE SUB D3ROTATE (BYVAL Points%, BYVAL XOrigin%, BYVAL
  9908.                YOrigin%, BYVAL ZOrigin%, BYVAL ZRAng%, BYVAL YRAng%, BYVAL
  9909.                XRAng%, SEG InAry%, SEG OutAry%)
  9910.             DECLARE SUB D3SCALE (BYVAL Points%, BYVAL XSCALE%, BYVAL
  9911.                YSCALE%, BYVAL ZScale%, SEG InAry%, SEG OutAry%)
  9912.             DECLARE SUB D3TRANSLATE (BYVAL Points%, BYVAL XTRANS%, BYVAL
  9913.                YTRANS%, BYVAL ZTrans%, SEG InAry%, SEG OutAry%)
  9914.             DECLARE SUB DRWBOX (BYVAL Mode%, BYVAL Colr%, BYVAL X1%, BYVAL
  9915.                Y1%, BYVAL X2%, BYVAL Y2%)
  9916.             DECLARE SUB DRWCIRCLE (BYVAL Mode%, BYVAL Colr%, BYVAL
  9917.                CenterX%, BYVAL CenterY%, BYVAL Radius%)
  9918.             DECLARE SUB DRWELLIPSE (BYVAL Mode%, BYVAL Colr%, BYVAL
  9919.                CenterX%, BYVAL CenterY%, BYVAL Radiusx%, BYVAL Radiusy%)
  9920.             DECLARE SUB DRWFILLBOX (BYVAL Mode%, BYVAL Colr%, BYVAL X1%,
  9921.                BYVAL Y1%, BYVAL X2%, BYVAL Y2%)
  9922.             DECLARE SUB DRWFILLCIRCLE (BYVAL Mode%, BYVAL Colr%, BYVAL
  9923.                CenterX%, BYVAL CenterY%, BYVAL Radius%)
  9924.             DECLARE SUB DRWFILLELLIPSE (BYVAL Mode%, BYVAL Colr%, BYVAL
  9925.                CenterX%, BYVAL CenterY%, BYVAL Radiusx%, BYVAL Radiusy%)
  9926.             DECLARE SUB DRWLINE (BYVAL Mode%, BYVAL Colr%, BYVAL X1%,
  9927.                BYVAL Y1%, BYVAL X2%, BYVAL Y2%)
  9928.             DECLARE SUB DRWPOINT (BYVAL Mode%, BYVAL Colr%, BYVAL X%,
  9929.                BYVAL Y%)
  9930.             DECLARE SUB DRWSTRING (BYVAL Mode%, BYVAL FColr%, BYVAL
  9931.                BColr%, Strng$, BYVAL X%, BYVAL Y%)
  9932.             DECLARE SUB DRWSTRINGDN (BYVAL Mode%, BYVAL FColr%, BYVAL
  9933.                BColr%, Strng$, BYVAL X%, BYVAL Y%)
  9934.             DECLARE SUB DRWSTRINGLT (BYVAL Mode%, BYVAL FColr%, BYVAL
  9935.                BColr%, Strng$, BYVAL X%, BYVAL Y%)
  9936.             DECLARE SUB DRWSTRINGRT (BYVAL Mode%, BYVAL FColr%, BYVAL
  9937.                BColr%, Strng$, BYVAL X%, BYVAL Y%)
  9938.             DECLARE SUB FILLAREA (BYVAL Xseed%, BYVAL Yseed%, BYVAL
  9939.                BorderColr%, BYVAL FillColr%)
  9940.             DECLARE SUB FILLCOLOR (BYVAL Xseed%, BYVAL Yseed%, BYVAL
  9941.                OldColr%, BYVAL NewColr%)
  9942.             DECLARE SUB FILLSCREEN (BYVAL Colr%)
  9943.             DECLARE SUB FILLPAGE (BYVAL Colr%)
  9944.             DECLARE SUB FILLVIEW (BYVAL Colr%)
  9945.             DECLARE SUB FONTGETINFO (SEG WDTH%, SEG HGHT%)
  9946.             DECLARE SUB FONTSET (FONT$)
  9947.             DECLARE SUB FONTSYSTEM ()
  9948.             DECLARE FUNCTION GETARCCOS% (BYVAL Value&)
  9949.             DECLARE FUNCTION GETARCSIN% (BYVAL Value&)
  9950.             DECLARE FUNCTION GETARCTAN% (BYVAL Value&)
  9951.             DECLARE FUNCTION GETCOS& (BYVAL Ang&)
  9952.             DECLARE FUNCTION GETSIN& (BYVAL Ang&)
  9953.  
  9954.  
  9955.                                                                         159
  9956.  
  9957.  
  9958.  
  9959.  
  9960.  
  9961.             DECLARE FUNCTION GETTAN& (BYVAL Ang&)
  9962.             DECLARE FUNCTION GETSQRT& (BYVAL Number&)
  9963.             DECLARE FUNCTION GETMAXX% ()
  9964.             DECLARE FUNCTION GETMAXY% ()
  9965.             DECLARE SUB GETLASTSTRING (SEG StrngGfxBlk%)
  9966.             DECLARE FUNCTION GETPOINT% (BYVAL X%, BYVAL Y%)
  9967.             DECLARE FUNCTION GIFMAKE% (FileName$, BYVAL X1%, BYVAL Y1%,
  9968.                BYVAL X2%, BYVAL Y2%)
  9969.             DECLARE FUNCTION GIFGETINFO% (Name$, SEG GifXSize%, SEG
  9970.                GifYSize%, SEG NumColors%, Pal$)
  9971.             DECLARE FUNCTION GIFPUT% (BYVAL Mode%, BYVAL Xloc%, BYVAL
  9972.                Yloc%, Name$)
  9973.             DECLARE SUB JOYSTICKINFO (SEG JAX%, SEG JAY%, SEG JAButs%, SEG
  9974.                JBX%, SEG JBY%, SEG JBButs%)
  9975.             DECLARE SUB MOUSEBUTPRESS (BYVAL ReqBut%, SEG Xloc%, SEG
  9976.                Yloc%, SEG Num%, SEG MButs%)
  9977.             DECLARE SUB MOUSEBUTRELEASE (BYVAL ReqBut%, SEG Xloc%, SEG
  9978.                Yloc%, SEG Num%, SEG MButs%)
  9979.             DECLARE SUB MOUSECURSORDEFAULT ()
  9980.             DECLARE SUB MOUSECURSORSET (MouseCursor$)
  9981.             DECLARE SUB MOUSEENTER ()
  9982.             DECLARE SUB MOUSEEXIT ()
  9983.             DECLARE SUB MOUSEHIDE ()
  9984.             DECLARE SUB MOUSEINFO (SEG DrvMajorVer%, SEG DrvMinorVer%, SEG
  9985.                MouseType%, SEG IRQnumber%)
  9986.             DECLARE SUB MOUSELOCSET (BYVAL Xloc%, BYVAL Yloc%)
  9987.             DECLARE SUB MOUSERANGESET (BYVAL X1%, BYVAL Y1%, BYVAL X2%,
  9988.                BYVAL Y2%)
  9989.             DECLARE SUB MOUSERESTORESTATE (SEG MouseBuf%)
  9990.             DECLARE SUB MOUSESAVESTATE (SEG MouseBuf%)
  9991.             DECLARE SUB MOUSESENSSET (BYVAL Xsens%, BYVAL Ysens%)
  9992.             DECLARE SUB MOUSESHOW ()
  9993.             DECLARE SUB MOUSESTATUS (SEG X%, SEG Y%, SEG MButs%)
  9994.             DECLARE FUNCTION MOUSESTORAGESIZE% ()
  9995.             DECLARE SUB OVERSCANSET (BYVAL Colr%)
  9996.             DECLARE FUNCTION PAGEDISPLAY% (BYVAL X%, BYVAL Y%, BYVAL
  9997.                Page%)
  9998.             DECLARE FUNCTION PAGEACTIVE% (BYVAL Page%)
  9999.             DECLARE SUB PALCHGAUTO (PalString$, NewPalString$, BYVAL
  10000.                FirstColr%, BYVAL LastColr%, BYVAL Speed%)
  10001.             DECLARE SUB PALCHGSTEP (PalString$, NewPalString$, BYVAL
  10002.                FirstColr%, BYVAL LastColr%, BYVAL Percent%)
  10003.             DECLARE SUB PALCOPY (SourcePalString$, DestPalString$, BYVAL
  10004.                FirstColr%, BYVAL LastColr%)
  10005.             DECLARE SUB PALDIMSTEP (PalString$, BYVAL FirstColr%, BYVAL
  10006.                LastColr%, BYVAL Percent%)
  10007.             DECLARE SUB PALGET (PalString$, BYVAL FirstColr%, BYVAL
  10008.                LastColr%)
  10009.             DECLARE SUB PALIOAUTO (PalString$, BYVAL FirstColr%, BYVAL
  10010.                LastColr%, BYVAL Speed%)
  10011.             DECLARE SUB PALROTATE (PalString$, BYVAL FirstColr%, BYVAL
  10012.                LastColr%, BYVAL Shift%)
  10013.             DECLARE SUB PALSET (PalString$, BYVAL FirstColr%, BYVAL
  10014.                LastColr%)
  10015.  
  10016.  
  10017.                                                                         160
  10018.  
  10019.  
  10020.  
  10021.  
  10022.  
  10023.             DECLARE FUNCTION RES320% ()
  10024.             DECLARE FUNCTION RES640L% ()
  10025.             DECLARE FUNCTION RES640% ()
  10026.             DECLARE FUNCTION RES800% ()
  10027.             DECLARE FUNCTION RES1024% ()
  10028.             DECLARE FUNCTION RESTEXT% ()
  10029.             DECLARE SUB SCROLLDN (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
  10030.                Y2%, BYVAL Num%, BYVAL Colr%)
  10031.             DECLARE SUB SCROLLLT (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
  10032.                Y2%, BYVAL Num%, BYVAL Colr%)
  10033.             DECLARE SUB SCROLLRT (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
  10034.                Y2%, BYVAL Num%, BYVAL Colr%)
  10035.             DECLARE SUB SCROLLUP (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
  10036.                Y2%, BYVAL Num%, BYVAL Colr%)
  10037.             DECLARE SUB SDELAY (BYVAL Count%)
  10038.             DECLARE SUB SETCARD (BYVAL CHIP%, BYVAL MEM%)
  10039.             DECLARE SUB SETVIEW (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL
  10040.                Y2%)
  10041.             DECLARE SUB SPRITEGAP (BYVAL TransColr%, BYVAL X%, BYVAL Y%,
  10042.                SEG SpriteGfxBlk%, SEG BkgndGfxBlk%)
  10043.             DECLARE SUB SPRITEGET (BYVAL TransColr%, BYVAL X%, BYVAL Y%,
  10044.                SEG SpriteGfxBlk%, SEG BkgndGfxBlk%)
  10045.             DECLARE SUB SPRITEPUT (BYVAL Mode%, BYVAL TransColr%, BYVAL
  10046.                X%, BYVAL Y%, SEG SpriteGfxBlk%)
  10047.             DECLARE FUNCTION SPRITECOLLDETECT% (BYVAL TransColr%, BYVAL
  10048.                Sprite1LocX%, BYVAL Sprite1LocY%, BYVAL Sprite2LocX%, BYVAL
  10049.                Sprite2LocY%, SEG Sprite1GfxBlk%, SEG Sprite2GfxBlk%)
  10050.             DECLARE FUNCTION VIDEOMODEGET% ()
  10051.             DECLARE SUB VIDEOMODESET (BYVAL Mode%)
  10052.             DECLARE SUB VIDEOOFF ()
  10053.             DECLARE SUB VIDEOON ()
  10054.             DECLARE FUNCTION WHICHCPU% ()
  10055.             DECLARE FUNCTION WHICHJOYSTICK% ()
  10056.             DECLARE FUNCTION WHICHMEM% ()
  10057.             DECLARE FUNCTION WHICHMOUSE% ()
  10058.             DECLARE FUNCTION WHICHVGA% ()
  10059.             DECLARE FUNCTION WHICHXMS% (SEG XmsKbytesAvailable%, SEG
  10060.                XmsHandlesAvailable%)
  10061.             DECLARE FUNCTION XMSALLOCATE% (BYVAL ReqKbytesOfMem%)
  10062.             DECLARE FUNCTION XMSERROR% ()
  10063.             DECLARE FUNCTION XMSFREE% (BYVAL XmsHandle%)
  10064.             DECLARE FUNCTION XMSGET% (BYVAL XmsHandle%, BYVAL
  10065.                OffsetIntoXms&, SEG DestVar%, BYVAL NumOfBytes&)
  10066.             DECLARE FUNCTION XMSPUT% (SEG SourceVar%, BYVAL XmsHandle%,
  10067.                BYVAL OffsetIntoXms&,  BYVAL NumOfBytes&)
  10068.             DECLARE FUNCTION XMSCOPY% (BYVAL XmsHandle1%, BYVAL
  10069.                OffsetIntoXms1&, BYVAL XmsHandle2%, BYVAL OffsetIntoXms2&,
  10070.                BYVAL NumOfBytes&)
  10071.  
  10072.             REM $DYNAMIC
  10073.  
  10074.  
  10075.  
  10076.  
  10077.  
  10078.  
  10079.                                                                         161
  10080.  
  10081.  
  10082.  
  10083.  
  10084.  
  10085.           APPENDIX B.  JOYSTICK PORTS AND Y-CABLES
  10086.  
  10087.           SCHEMATIC WIRING DIAGRAM FOR A STANDARD JOYSTICK PORT
  10088.  
  10089.                                     DB15 male
  10090.                                     connector
  10091.                    Joystick B            ___       Joystick A
  10092.                                       __/   |
  10093.                                      /    o | 1 -------------------+
  10094.              +------------------  9 | o     |     ___Button A      |
  10095.              |     Button A___      |     o | 2 --o o-+            |
  10096.              |           +-o o-- 10 | o     |         |    X Axis  |
  10097.              |  X Axis   |          |     o | 3 -------------+     |
  10098.              |     +------------ 11 | o     |         |      |     |
  10099.              |     |     |          |     o | 4 ------+      |     |
  10100.              +--/\/\/\   +------ 12 | o     |         |    /\/\/\--+
  10101.              |           |          |     o | 5       |            |
  10102.              |     +------------ 13 | o     |         |            |
  10103.              |     |     | ___      |     o | 6 -------------+     |
  10104.              |     |     +-o o-- 14 | o     |     ___ |      |     |
  10105.              |     |    Button B    |     o | 7 --o o-+      |     |
  10106.              |     |             15 | o     |   Button B   /\/\/\--+
  10107.              +--/\/\/\               \__  o | 8            Y Axis
  10108.                Y Axis                   \___|
  10109.  
  10110.           Notes:
  10111.  
  10112.           1)This diagram comes with NO warranties expressed or implied.
  10113.             It is provided for information only.  In no event shall
  10114.             Stephen L. Balkum, Daniel A. Sill or Zephyr Software be held
  10115.             liable for damages resulting from use, misuse, or inability to
  10116.             use this information.
  10117.  
  10118.           2)The x and y axis potentiometers have a typical range of 0 to
  10119.             100k ohms.  Buttons are normally open and close when pressed.
  10120.  
  10121.           3)This diagram is correct for joystick ports that conform to the
  10122.             standard set forth by IBM. Some specialty joystick cards
  10123.             provide separate A and B joystick connectors.  For these
  10124.             cards, both connectors are wired to pins 1 through 8 as shown
  10125.             in the diagram.
  10126.  
  10127.           4)Many 'Super I/O' boards (2H/2F/2S/1P/1G) equipped with a
  10128.             joystick port will support only one joystick.  On these cards,
  10129.             pins 9 through 15 are not used.
  10130.  
  10131.           5)Commercially available joysticks are wired to use pins 1
  10132.             through 8 and, therefore, will always be 'Joystick A' if
  10133.             plugged directly into a dual joystick port connector.
  10134.  
  10135.           6)Many sound cards provide joystick ports; however, their
  10136.             connector wiring does not always conform to the standard shown
  10137.             above.  Some of these connectors may be used for other
  10138.  
  10139.  
  10140.  
  10141.                                                                         162
  10142.  
  10143.  
  10144.  
  10145.  
  10146.  
  10147.             purposes such as a MIDI port.  See the documentation that
  10148.             comes with the sound card.
  10149.  
  10150.           7)If there is more than one joystick port on a computer
  10151.             configured to operate the same joystick, only ONE port should
  10152.             be enabled at any given time for proper operation.  Disable
  10153.             all but one joystick port.  For example, if the computer has
  10154.             both a Super I/O card and a sound card, the joystick port on
  10155.             the Super I/O card should be disabled since the sound card's
  10156.             port probably supports two joysticks and the I/O card supports
  10157.             only one.
  10158.  
  10159.  
  10160.  
  10161.  
  10162.  
  10163.  
  10164.  
  10165.  
  10166.  
  10167.  
  10168.  
  10169.  
  10170.  
  10171.  
  10172.  
  10173.  
  10174.  
  10175.  
  10176.  
  10177.  
  10178.  
  10179.  
  10180.  
  10181.  
  10182.  
  10183.  
  10184.  
  10185.  
  10186.  
  10187.  
  10188.  
  10189.  
  10190.  
  10191.  
  10192.  
  10193.  
  10194.  
  10195.  
  10196.  
  10197.  
  10198.  
  10199.  
  10200.  
  10201.  
  10202.  
  10203.                                                                         163
  10204.  
  10205.  
  10206.  
  10207.  
  10208.  
  10209.           SCHEMATIC WIRING DIAGRAM FOR A JOYSTICK Y-CABLE
  10210.                                               ___
  10211.                          DB15 male         __/   |
  10212.                        connector to       /    o | 1 --------+
  10213.                        Joystick Port   9 | o     |           |
  10214.                         on computer      |     o | 2 --------|-+
  10215.                             +-------- 10 | o     |           | |
  10216.                             |            |     o | 3 --------|-|-+
  10217.                             | +------ 11 | o     |           | | |
  10218.                             | |          |     o | 4 --------|-|-|-+
  10219.                             | |       12 | o     |           | | | |
  10220.                             | |          |     o | 5         | | | |
  10221.                             | | +---- 13 | o     |           | | | |
  10222.                             | | |        |     o | 6 --------|-|-|-|-+
  10223.                             | | | +-- 14 | o     |           | | | | |
  10224.                             | | | |      |     o | 7 --------|-|-|-|-|-+
  10225.                             | | | |   15 | o     |           | | | | | |
  10226.                             | | | |       \__  o | 8         | | | | | |
  10227.                             | | | |          \___|           | | | | | |
  10228.                             | | | |                          | | | | | |
  10229.                             | | | |                          | | | | | |
  10230.                             | | | |  +-----------------------+ | | | | |
  10231.                             | | | |  |                       | | | | | |
  10232.                             | | | |  | +---------------------|-|-|-+ | |
  10233.                             | | | |  | |                     | | | | | |
  10234.                             | | | |  | |                     | | | | | |
  10235.            DB15 female      | | | |  | |     DB15 female     | | | | | |
  10236.            connector to     | | | |  | |     connector to    | | | | | |
  10237.             Joystick B      | | | |  | |      Joystick A     | | | | | |
  10238.                   ___       | | | |  | |            ___      | | | | | |
  10239.                __/   |      | | | |  | |         __/   |     | | | | | |
  10240.               /    o | 1 ---|-|-|-|--+ |        /    o | 1 --+ | | | | |
  10241.            9 | o     |      | | | |    |     9 | o     |       | | | | |
  10242.              |     o | 2 ---+ | | |    |       |     o | 2 ----+ | | | |
  10243.           10 | o     |        | | |    |    10 | o     |         | | | |
  10244.              |     o | 3 -----+ | |    |       |     o | 3 ------+ | | |
  10245.           11 | o     |          | |    |    11 | o     |           | | |
  10246.              |     o | 4 -------|-|----+       |     o | 4 --------+ | |
  10247.           12 | o     |          | |         12 | o     |             | |
  10248.              |     o | 5        | |            |     o | 5           | |
  10249.           13 | o     |          | |         13 | o     |             | |
  10250.              |     o | 6 -------+ |            |     o | 6 ----------+ |
  10251.           14 | o     |            |         14 | o     |               |
  10252.              |     o | 7 ---------+            |     o | 7 ------------+
  10253.           15 | o     |                      15 | o     |
  10254.               \__  o | 8                        \__  o | 8
  10255.                  \___|                             \___|
  10256.  
  10257.           Notes:
  10258.  
  10259.           1)This diagram comes with NO warranties expressed or implied.
  10260.             It is provided for information only.  In no event shall
  10261.             Stephen L. Balkum, Daniel A. Sill or Zephyr Software be held
  10262.  
  10263.  
  10264.  
  10265.                                                                         164
  10266.  
  10267.  
  10268.  
  10269.  
  10270.  
  10271.             liable for damages resulting from use, misuse, or inability to
  10272.             use this information.
  10273.  
  10274.           2)This cable has worked with a standard joystick port connector,
  10275.             a Sound Blaster port connector, and a Sound Blaster Pro
  10276.             joystick port connector.
  10277.  
  10278.  
  10279.  
  10280.  
  10281.  
  10282.  
  10283.  
  10284.  
  10285.  
  10286.  
  10287.  
  10288.  
  10289.  
  10290.  
  10291.  
  10292.  
  10293.  
  10294.  
  10295.  
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301.  
  10302.  
  10303.  
  10304.  
  10305.  
  10306.  
  10307.  
  10308.  
  10309.  
  10310.  
  10311.  
  10312.  
  10313.  
  10314.  
  10315.  
  10316.  
  10317.  
  10318.  
  10319.  
  10320.  
  10321.  
  10322.  
  10323.  
  10324.  
  10325.  
  10326.  
  10327.                                                                         165